Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. 

 

  1. 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!)

image2016-11-1 15_41_38.jpgImage Removed

  1. 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 PuTTySecureCRT, 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 

...