The ScopTEL IP PBX supports different methods for High Availability and replication of MySQL databases; this article will explain the easiest way to configure two (2) servers in a failover (active/passive) scenario.
We will show how to replicate the configuration, voicemail, and prompts from the Master with the IP address 192.168.99.164 to a Slave (192.168.99.165) using a Floating IP Address (192.168.99.100).
Both servers must use the ScopServ installation disk (ISO). The image is available to download at http://download.scopserv.com/iso/
The shared partition must exist on both servers as a primary partition and the mount point must be /share
In order to simplify the configuration of the High Availability setup, we automatically created a shared 10GB partition on the disk layout.
We highly recommend not to exceed a shared partition of 10Gb due to the length of time required to sync the shared partition. The maximum shared partition size is 50Gb
You must absolutely use Server version 2.6.9 or greater and Telephony version 2.7.16 or greater.
We highly recommend that you update all packages to the latest versions. To proceed, go to Server -> Packages Manager and click on Update Now.
We strongly recommend reading the ‘DRBD User’s Guide’ available at http://www.drbd.org/users-guide-8.3/ that covers all aspect of Shared Storage (DRBD), including troubleshooting informations.
Preparing your Network Configuration
It is recommended, though not strictly required, that you run your Shared Storage (DRBD) replication over a dedicated connection. The most reasonable choice for this is a direct, back-to-back, Gigabit Ethernet connection. When the Shared Storage (DRBD) service is run over switches, use of redundant components is recommended.
It is generally not recommended to run Shared Storage (DRBD) replication via routers, for reasons of fairly obvious performance drawbacks (adversely affecting both throughput and latency).
– The Floating IP Address that will be used by VoIP devices is set to 192.168.99.100
– The Master Server is configured to use the hostname master.local and the IP Address 192.168.99.164
– The Slave Server will use slave.local as the hostname and the IP Address 192.168.99.165
It is very important that both servers can ping each other using the hostname and IP address. On both servers, go to Network -> Configuration and verify that the specified hostname matches. On Network -> Static Hosts, you can create a hostname for each server.
On both servers, go on Server -> MySQL Server -> Configuration and check the option Enable High Availability Support and click Save (do not change any of the default settings).
High Availability Configuration
First, we have to edit the High Availability configuration on the GUI of BOTH servers. We have to enable Automatic Failover (Heartbeat) and Shared Network Storage (DRBD) on Server -> High Availability.
We have to specify the Floating IP Address (192.168.99.100), the Primary (192.168.99.164), and Secondary (192.168.99.165) Server IP Addresses, and Hostnames.
For Shared Storage, you will have to specify the disk partition used for the shared storage. From SSH, you can use the df command to retrieve the disk device. In this sample, the shared device is /dev/hda2
[note color=#ddd]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 65164472 2303744 59497120 4% /
/dev/hda1 101086 17217 78650 18% /boot
/dev/hda2 10080168 153732 9414384 2% /share[/note]
Make sure the High Availability configuration is correctly set as follows:
On the Options tab, you must absolutely enable the Telephony Server (Asterisk) and MySQL Database modules. It is recommended to enable all modules for a complete replication.
Before continuing, verify on both servers that directory /share exists. If it’s not the case, create it (located at root) using the command mkdir share, and affect it the right owner user/group with chown -R scopserv:scopserv /share
Reboot both servers to affect all network changes.
Enabling Services and Initializing Shared Storage
Under Configuration -> Server -> General, make sure that Heartbeat (Failover) and Shared Storage (DRBD) services are enabled. You must start these services on both servers.
Once the services are running, you must initialize the Shared Storage partition. On the Master server, click on Initialize DRBD and a popup window will appear and ask you to confirm the initialization. You must wait for completion before executing the next step. Please be patient, completion of this step can take approximately 5-10 minutes.
Now that the initialization is complete on the Master server, you can go to the Slave server, click on Initialize DRBD and the following popup window will appear:
Services Status and Verification
The High Availability and Shared Storage are configured and the synchronization of the disk must be in progress (see following image).
When the synchronization is complete, the status available on Server -> General must look like the following:
At this point, HA is configured and running. It’s now time to make some modifications in configuration to affect floating IP address.
On both servers:
- Server -> Configuration -> Provisioning:
- SIP Server Address
- TFTP Provisioning
- HTTP Provisioning
On Master Server only:
- Telephony -> Configuration -> Provisioning: Default SIP Server
- Telephony -> Configuration -> Channels:
- SIP Channel: Binding Address
- IAX Channel: Address