Now we can see how to install add-ons in a high-availability environment. We will take an in-depth look into the process of adding add-ons that have a service running on the servers. This includes the Sonata Suite, VitXi, OpenVPN, and Maintenance add-on modules. These add-ons require special steps for installation in high-availability environments.
Let’s begin with the Sonata Suite. The first application of Sonata Suite we will look into installing is Sonata Switchboard.
Before proceeding, make sure that the Primary Server is set as a Master. You can use the role command to verify this.
First, go to the Floating IP Address on your browser. There, install Sonata Switchboard as normal from Admin > Add-Ons > Add-Ons. Then, go to the Sonata Switchboard URL, which is https://FloatingIPAddress/switchboard by default. Follow the installation wizard and finish installing Sonata Switchboard.
Next, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands in the Primary Server.
root@debian:~# tar -zcvf switchboard-settings.tgz /etc/switchboard/settings.conf
root@debian:~# tar xvfz switchboard-settings.tgz -C /vpbx_data/
root@debian:~# rm -rf /etc/switchboard/settings.conf
root@debian:~# ln -s /vpbx_data/etc/switchboard/settings.conf /etc/switchboard/settings.conf
root@debian:~# rm -rf switchboard-settings.tgz
Afterward, run the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Now, go back to the Floating IP Address on your browser. You will now be navigating on the Secondary Server. Here, install Sonata Switchboard as you did in the Primary Server by installing the add-on and following the Wizard.
Then, create the symbolic link for the settings.conf file in the Secondary Server.
root@debian:~# rm -rf /etc/switchboard/settings.conf
root@debian:~# ln -s /vpbx_data/etc/switchboard/settings.conf /etc/switchboard/settings.conf
Finally, execute the bascul command once again from the Primary Server to return the cluster back to normal where the Primary Server is set as the Master.
root@debian:~# bascul
With this, you now have Sonata Switchboard installed in your high-availability environment.
Let’s move on to Sonata Recordings. The process will be very similar to the Sonata Switchboard. With the difference of adding the Sonata Recordings service automation at the end.
First, go to the Floating IP Address on your browser. Here, install Sonata Recordings from the add-ons module under Admin > Add-Ons > Add-Ons. Once installed, go to the Sonata Recordings URL, which is https://FloatingIPAddress/recordings by default. There, follow the wizard to finish with the installation.
Next, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf recording-settings.tgz /etc/rec-manager/settings.conf
root@debian:~# tar xvfz recording-settings.tgz -C /vpbx_data/
root@debian:~# rm -rf /etc/rec-manager/settings.conf
root@debian:~# ln -s /vpbx_data/etc/rec-manager/settings.conf /etc/rec-manager/settings.conf
root@debian:~# rm -rf recording-settings.tgz
Now, execute the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@vitalpbx-master:~# bascul
Afterward, go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install Sonata Recordings as you did on the Primary Server.
Then, create the symbolic link for the settings.conf file on the Secondary Server.
root@debian:~# rm -rf /etc/rec-manager/settings.conf
root@debian:~# ln -s /vpbx_data/etc/rec-manager/settings.conf /etc/rec-manager/settings.conf
Now, execute the bascul command on the Primary Server to return the cluster to normal where the Primary Server is the Master.
root@debian:~# bascul
Finally, add the Sonata Recordings service automation. Run the following commands on both servers.
root@debian:~# systemctl stop recordings
root@debian:~# systemctl disable recordings
Then, run the following commands on the Primary Server.
root@debian:~# pcs resource create sonata-recordings service:recordings op monitor interval=30s
root@debian:~# pcs cluster cib fs_cfg
root@debian:~# pcs cluster cib-push fs_cfg --config
root@debian:~# pcs -f fs_cfg constraint colocation add sonata-recordings with ClusterIP INFINITY
root@debian:~# pcs -f fs_cfg constraint order vpbx-monitor then sonata-recordings
root@debian:~# pcs cluster cib-push fs_cfg --config
With this, you now have Sonata Recordings installed in your high-availability environment.
Let’s move towards Sonata Billing. The process will be exactly the same as the Sonata Switchboard.
First, go to the Floating IP Address and install Sonata Billing from the add-ons module under Admin > Add-Ons > Add-Ons. Once installed, go to the Sonata Billing URL, which is https://FloatingIPAddress/billing by default. There, follow the wizard and finish the installation.
Next, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf billing-settings.tgz /etc/billing/settings.conf
root@debian:~# tar xvfz billing-settings.tgz -C /vpbx_data/
root@debian:~# rm -rf /etc/billing/settings.conf
root@debian:~# ln -s /vpbx_data/etc/billing/settings.conf /etc/billing/settings.conf
root@debian:~# rm -rf billing-settings.tgz
Now, execute the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install Sonata Billing as you did in the Primary Server.
Then, create the symbolic link for the settings.conf file on the Secondary Server.
root@debian:~# rm -rf /etc/billing/settings.conf
root@debian:~# ln -s /vpbx_data/etc/billing/settings.conf /etc/billing/settings.conf
Finally, execute the bascul command once again from the Primary Server to return the cluster back to normal where the Primary Server is set as the Master.
root@debian:~# bascul
With this, you now have Sonata Billing installed in your high-availability environment.
Let’s continue with Sonata Stats. This process is similar to Sonata Recordings but has some additional files to copy.
First, go to the Floating IP Address on your browser and install Sonata Stats from the add-ons module under Admin > Add-Ons > Add-Ons. Then, go to the Sonata Stats URL which is https://FloatingIPAddress/stats by default. There, follow the wizard to finish with the installation. Next, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf stats-env.tgz /usr/share/queues-stats/backend/.env
root@debian:~# tar -zcvf stats-wizard.tgz /var/lib/sonata/stats/wizard.conf
root@debian:~# tar xvfz stats-env.tgz -C /vpbx_data/
root@debian:~# tar xvfz stats-wizard.tgz -C /vpbx_data/
root@debian:~# rm -rf /usr/share/queues-stats/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/queues-stats/backend/.env /usr/share/queues-stats/backend/.env
root@debian:~# rm -rf /var/lib/sonata/stats/wizard.conf
root@debian:~# ln -s /vpbx_data/var/lib/sonata/stats/wizard.conf /var/lib/sonata/stats/wizard.conf
root@debian:~# rm -rf stats-env.tgz
root@debian:~# rm -rf stats-wizard.tgz
Now, execute the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install Sonata Stats as you did in the Primary Server.
Then, create the symbolic link for the .env file on the Secondary Server.
root@debian:~# rm -rf /usr/share/queues-stats/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/queues-stats/backend/.env /usr/share/queues-stats/backend/.env
root@debian:~# rm -rf /var/lib/sonata/stats/wizard.conf
root@debian:~# ln -s /vpbx_data/var/lib/sonata/stats/wizard.conf /var/lib/sonata/stats/wizard.conf
root@debian:~# cd /usr/share/queues-stats/backend/
root@debian:~# php artisan config:cache && php artisan route:cache && php artisan view:cache
Now, execute the bascul command on the Primary Server to return the cluster to normal where the Primary Server is the Master.
root@debian:~# bascul
Finally, add the Sonata Stats service automation. Run the following commands on both servers.
root@debian:~# systemctl stop sonata-stats
root@debian:~# systemctl disable sonata-stats
Then, run the following commands in the Primary Server.
root@debian:~# pcs resource create sonata-stats service:sonata-stats op monitor interval=30s
root@debian:~# pcs cluster cib fs_cfg
root@debian:~# pcs cluster cib-push fs_cfg --config
root@debian:~# pcs -f fs_cfg constraint colocation add sonata-stats with ClusterIP INFINITY
root@debian:~# pcs -f fs_cfg constraint order vpbx-monitor then sonata-stats
root@debian:~# pcs cluster cib-push fs_cfg --config
With this, you now have Sonata Billing installed in your high-availability environment.
Let’s finish with the Sonata Suite with Sonata Dialer. The process is similar to the Sonata Stats.
First, go to the Floating IP Address on your browser, and install Sonata Dialer from the add-ons module under Admin > Add-Ons > Add-Ons. Once installed, go to the Sonata Dialer URL which is https://FloatingIPAddress/dialer by default. There, follow the wizard to finish the installation.
Next, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf dialer-env.tgz /usr/share/dialer/backend/.env
root@debian:~# tar -zcvf dialer-wizard.tgz /var/lib/sonata/dialer/wizard.conf
root@debian:~# tar xvfz dialer-env.tgz -C /vpbx_data/
root@debian:~# tar xvfz dialer-wizard.tgz -C /vpbx_data/
root@debian:~# rm -rf /usr/share/dialer/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/dialer/backend/.env /usr/share/dialer/backend/.env
root@debian:~# rm -rf /var/lib/sonata/dialer/wizard.conf
root@debian:~# ln -s /vpbx_data/var/lib/sonata/dialer/wizard.conf /var/lib/sonata/dialer/wizard.conf
root@debian:~# rm -rf dialer-env.tgz
Now, execute the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install Sonata Stats as you did in the Primary Server.
Then, create the symbolic links for the .env file on the Secondary Server.
root@debian:~# rm -rf /usr/share/dialer/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/dialer/backend/.env /usr/share/dialer/backend/.env
root@debian:~# rm -rf /var/lib/sonata/dialer/wizard.conf
root@debian:~# ln -s /vpbx_data/var/lib/sonata/dialer/wizard.conf /var/lib/sonata/dialer/wizard.conf
root@debian:~# cd /usr/share/dialer/backend/
root@debian:~# php artisan config:cache && php artisan route:cache && php artisan view:cache
Now, execute the bascul command on the Primary Server to return the cluster to normal where the Primary Server is the Master.
root@debian:~# bascul
Finally, add the Sonata Dialer service automation. Run the following commands on both servers
root@debian:~# systemctl stop sonata-dialer
root@debian:~# systemctl disable sonata-dialer
Then, run the following commands in the Primary Server.
root@debian:~# pcs resource create sonata-dialer service:sonata-dialer op monitor interval=30s
root@debian:~# pcs cluster cib fs_cfg
root@debian:~# pcs cluster cib-push fs_cfg --config
root@debian:~# pcs -f fs_cfg constraint colocation add sonata-dialer with ClusterIP INFINITY
root@debian:~# pcs -f fs_cfg constraint order vpbx-monitor then sonata-dialer
root@debian:~# pcs cluster cib-push fs_cfg --config
With this, you now have Sonata Dialer installed in your high-availability environment. Now all of the Sonata Suite is up and running in your high-availability environment!
Let’s move towards VitXi, our WebRTC solution.
Beforehand, make sure that your cluster is normalized with the Primary Server set as the Master. You can use the role command to verify this.
First, go to the Floating IP Address on your browser, and follow the installation procedure for VitXi from VitXi’s manual. VitXi installation requires you to install the add-on from Admin > Add-Ons > Add-ons, make various VitalPBX configurations, and follow the installation wizard from VitXi’s URL which is https://FloatingIPAddress/webrtc by default. This process is detailed in VitXi’s manual.
With VitXi completely installed and VitalPBX configured, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf vitxi-env.tgz /usr/share/vitxi/backend/.env
root@debian:~# tar -zcvf vitxi-storage.tgz /usr/share/vitxi/backend/storage
root@debian:~# tar -zcvf vitxi-wizard.tgz /var/lib/vitxi/wizard.conf
root@debian:~# tar xvfz vitxi-env.tgz -C /vpbx_data/
root@debian:~# tar xvfz vitxi-storage.tgz -C /vpbx_data/
root@debian:~# tar xvfz vitxi-wizard.tgz -C /vpbx_data/
root@debian:~# rm -rf /usr/share/vitxi/backend/.env
root@debian:~# rm -rf /usr/share/vitxi/backend/storage
root@debian:~# rm -rf /var/lib/vitxi/wizard.conf
root@debian:~# ln -s /vpbx_data/usr/share/vitxi/backend/.env /usr/share/vitxi/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/vitxi/backend/storage /usr/share/vitxi/backend/storage
root@debian:~# ln -s /vpbx_data/var/lib/vitxi/wizard.conf /var/lib/vitxi/wizard.conf
root@debian:~# rm -rf vitxi-env.tgz
root@debian:~# rm -rf vitxi-storage.tgz
root@debian:~# rm -rf vitxi-wizard.tgz
Run the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install Sonata Stats as you did in the Primary Server.
Then, create the symbolic links for the .env file on the Secondary Server.
root@debian:~# rm -rf /usr/share/vitxi/backend/.env
root@debian:~# ln -s /vpbx_data/usr/share/vitxi/backend/.env /usr/share/vitxi/backend/.env
root@debian:~# rm -rf /var/lib/vitxi/wizard.conf
root@debian:~# ln -s /vpbx_data/var/lib/vitxi/wizard.conf /var/lib/vitxi/wizard.conf
root@debian:~# rm -rf /usr/share/vitxi/backend/storage
root@debian:~# ln -s /vpbx_data/usr/share/vitxi/backend/storage /usr/share/vitxi/backend/storage
root@debian:~# cd /usr/share/vitxi/backend/
root@debian:~# php artisan config:cache && php artisan route:cache && php artisan view:cache
Now, execute the bascul command on the Primary Server to return the cluster to normal where the Primary Server is the Master.
Finally, add the Sonata Dialer service automation. Run the following commands on both servers.
root@debian:~# systemctl stop vitxi
root@debian:~# systemctl disable vitxi
Then, run the following commands in the Primary Server.
root@debian:~# pcs resource create vitxi service:vitxi op monitor interval=30s
root@debian:~# pcs cluster cib fs_cfg
root@debian:~# pcs cluster cib-push fs_cfg --config
root@debian:~# pcs -f fs_cfg constraint colocation add vitxi with ClusterIP INFINITY
root@debian:~# pcs -f fs_cfg constraint order vpbx-monitor then vitxi
root@debian:~# pcs cluster cib-push fs_cfg --config
With this, you now have VitXi installed in your high-availability environment!
We can now move towards the OpenVPN add-on module.
First, go to the Floating IP Address on your browser, and install the OpenVPN add-on from the add-ons module under Admin > Add-Ons > Add-Ons.
Once installed, copy the files that we are going to replicate from the Primary Server to the Secondary Server. Run the following commands on the Primary Server.
root@debian:~# tar -zcvf etc-openvpn.tgz /etc/openvpn
root@debian:~# tar xvfz etc-openvpn.tgz -C /vpbx_data/
root@debian:~# rm -rf /etc/openvpn
root@debian:~# ln -s /vpbx_data/etc/openvpn /etc/openvpn
root@debian:~# rm -rf etc-openvpn.tgz
Run the bascul command on the Primary Server to turn the Secondary Server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Here, install the OpenVPN add-on as you did in the Primary Server.
Then, create the symbolic link for the OpenVPN Path on the Secondary Server.
root@debian:~# rm -rf /etc/openvpn
root@debian:~# ln -s /vpbx_data/etc/openvpn /etc/openvpn
Finally, add the OpenVPN service automation. Run the following commands on both servers.
root@debian:~# systemctl stop openvpn
root@debian:~# systemctl disable openvpn
Then, run the following commands in the Primary Server.
root@debian:~# pcs resource create openvpn service:openvpn op monitor interval=30s
root@debian:~# pcs cluster cib fs_cfg
root@debian:~# pcs cluster cib-push fs_cfg --config
root@debian:~# pcs -f fs_cfg constraint colocation add openvpn with ClusterIP INFINITY
root@debian:~# pcs -f fs_cfg constraint order vpbx-monitor then openvpn
root@debian:~# pcs cluster cib-push fs_cfg --config
With this, you now have OpenVPN installed in your high-availability environment!
Let’s move toward the Maintenance add-on. This is the final add-on that requires special steps for installation in a high-availability environment.
First, go to the Floating IP Address on your browser and install the Maintenance add-on module from the add-ons module under Admin > Add-Ons > Add-Ons.
Once installed, execute the bascul command on the Primary Server to turn the Secondary server into the Master.
root@debian:~# bascul
Go back to the Floating IP Address on your browser. You will now be navigating the Secondary Server. Install the Maintenance add-on as you did on the Primary Server.
Afterward, run the bascul command on the Primary Server once again to return the cluster to normal, where the Primary Server is set as the Master.
root@debian:~# bascul
Because the Maintenance cron file is copied to a shared directory at /etc/cron.d/vpbx_maintenace that has other system cron services active, we recommend first creating the Maintenance on the Primary Server first, then using the bascul command to switch the server roles, and finally create the same maintenance on the Secondary Server.
Since the databases are synchronized, it is only necessary to go to Admin > Tools > Maintenance and click on Save and Apply Changes.
With this, you now have the Maintenance add-on installed in a high-availability environment.
These are all the add-ons that require special attention and steps for installation in a High Availability environment. The rest of the add-ons can be installed similarly to how the Maintenance add-on was installed. The general steps for the rest of the add-ons are as follows.
- Verify that the server cluster is normalized where the Primary Server is set as the Master. This can be verified with the role command.
- Go to the Floating IP Address on your browser.
- Install the add-on on the Primary Server from the add-ons module under Admin > Add-Ons > Add-Ons.
- Use the bascul command to switch the servers’ roles.
- Install the add-on on the Secondary Server from the add-ons module under Admin > Add-Ons > Add-Ons.
- Use the bascul command again to normalize the server cluster and have the Primary Server as the Master.
With this done, you now have a full high-availability environment with add-ons in VitalPBX 4!