Note |
---|
This information on this page applies only to PBX versions 15.x and above. For version 14.x or lower please see: Warm Spare Setup |
Table of Contents |
---|
Introduction
...
The Warm Spare setup on PBX 15+ has changed from the way it used to be in older versions.
We are now using the Filestore , API and Backup & Restore modules for the Warm spare Backup configuration, so we need to ensure that all 3 mentioned modules are present in both Primary and Secondary server.
...
the process needs to send data from the primary to the warmspare. We can either use FTP or SSH protocol to perform this task using Filestore module (SSH is the recommended path)
SSH Configuration
In this section, we will describe how to configure "SSH" to use for Warm Spare setup.
First, we will set up shared keys between the two servers so they can communicate across SSH on port 22. PBX 15+ onward there is no need of generating SSH Keys for the Primary server. Backup & Restore module will take care of generating SSH Keys by itself. But we have to copy the Primary Server SSH Keys to Secondary server to ensure that Primary can communicate with Secondary server easily.
We can use any one of the following 2 methods to copy the SSH keys to Secondary (Warm spare) server.
Manually copy the SSH Keys to Secondary Server
"FreePBX GUI - > Admin → Backup & Restore → Global Settings" has server SSH keys which we can copy to Secondary server manually. (note some browsers may not let you copy this data)
...
You may copy this key to spare/Secondary server manually to /root/.ssh/authorized_keys file. Create a file called "authorized_keys" (if not present) and add your Public Key in that file. If that file already exists just add your Key to the end of the file (make sure each key is separated by a new line!)
Using SSH CLI command to copy Primary SSH keys to Secondary server (preferred method)
Note |
---|
Please note if you are doing this from a fresh install and have never visited the backup and restore module these steps will FAIL. Before proceeding go to the backup and restore module in the GUI , this triggers creation of keys referenced below. Once in the module click on the global settings tab and confirm the key is present as shown above |
Login to your Primary server with an SSH client such as PuTTy, SecureCRT, or other SSH client.
We will copy the key to the Secondary server with the help of the following command so that the primary server can SSH to the secondary server without needing a password.
At the primary server Linux CLI prompt type: sudo -u asterisk ssh-copy-id -i /home/asterisk/.ssh/id_rsa.pub root@SecondaryServerIP and enter the password when prompted.
Info |
---|
APPLICATION NOTES Make sure you replace the SecondaryServerIP with the IP Address of your Secondary PBX. (use IP and not a hostname that may be common to both primary and warmspare; if fqdns are desired create 3 records the common name , specific name for primary and specific name for warm spare - ie mypbx.company.com , mypbx1.company.com , mypbx2.company.com) If the Firewall is configured, pay attention to creating the right rule allowing the two servers to talk to each other. |
If this command completes without error, you are ready to test:
At the prompt type: ssh -i /home/asterisk/.ssh/id_rsa root@SecondaryServerIP
If all went well, you should now be logged in to the Secondary Please refer to Setting up the SSH key section to set the SSH association between primary and warmspare server.
Filestore Module Setup
...
Create the Application Machine to Machine App
Allow the scope(gql:backup) to access the backup module and then "Add Application".
Copy the Access details to notepad or text editor, you will need this info when we setup the replication job on the Primary server.
...