3CX Passive Failover Support #
3CX supports an Active/Passive failover environment where a copy of the 3CX installation is maintained on a secondary server. In the event of a failure on the primary server, the secondary server can be activated to take over operations.
When installing ~.Dimensions.~ into this enviroment, there are specific considerations to ensure that data collection continues in the event of a failover.
| 3CX Server | ~.Dimensions.~ Installation |
|---|---|
| Primary | Installed, service started |
| Failover | Installed, service stopped |
~.Dimensions.~ only supports a single feed at a time from a 3CX installation. To implement the Active/Passive failover, the ~.Dimensions.~ service must be installed on both servers, but only started on the Primary server. When a failover event occurs, the Passive server will start the ~.Dimensions.~ service so that it models calls/state on the passive server.
warning
When the passive server takes over, it is possible that the ~.Dimensions.~ is still running on the Primary server even though it is failed over. Ensure this is stopped to prevent two instances of the ~.Dimensions.~ service running at the same time.
Failover Server Installation #
Follow the normal installation procedure on the failover server, but do not start the ~.Dimensions.~ service.
Once the installation has completed, stop the ~.Dimensions.~ service and set it do 'disabled' using the following commands:
systemctl disable --now RemoteCollector.ThreeCx.serviceThe service should now be installed, but set to not auto start.
3CX Configuration #
Now that the ~.Dimensions.~ service is installed on the Passive server, scripts need updating on the Passive server to automatically start the ~.Dimensions.~ service when the 3CX services are started.
In the 'Backup/Failover' of the 3CX admin, add a script to the*'Script to launch AFTER 3CX Service are started'* section. The script should contain the following commands:
sshpass -p "password" ssh user@primary-server "sudo systemctl stop RemoteCollector.ThreeCx.service"
systemctl start RemoteCollector.ThreeCx.serviceIn the first command, replace user with the username used to SSH into the Primary server, password with the password for that user and primary-server with the hostname or IP address of the Primary server.
This command stops the ~.Dimensions.~ service on the Primary server to ensure that only a single instance of the service is running.
The second command starts the ~.Dimensions.~ service on the Passive server.
With this configured on the Passive server, when a failover occurs and the 3CX services are started, the ~.Dimensions.~ service will also be started.
info
If you already have a script in this section, append the command to the end of the existing script.
Rollback Procedure #
When the Primary server is restored, the failover process needs to be reversed to ensure that the ~.Dimensions.~ service is running on the Primary server and stopped on the Passive server.
On the Secondary server, stop the service and disable it using the following command:
systemctl disable --now RemoteCollector.ThreeCx.serviceOn the Primary server, restart the service using the following command:
systemctl start RemoteCollector.ThreeCx.service