How to install VitalPBX 3 on High Availability

VitalPBX 3 Hight Availability
Share on facebook
Share on twitter
Share on whatsapp
Share on telegram
Share on linkedin
Share on email

High availability is a characteristic of a system which aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period.

Make a high-availability cluster out of any pair of VitalPBX servers. VitalPBX can detect a range of failures on one VitalPBX server and automatically transfer control to the other server, resulting in a telephony environment with minimal down time.

Read our tutorials and guides on how to implement new tools and technologies for your business with VitalPBX here.


In order to install VitalPBX in high availability you need the following:
a.- 3 IP addresses.
b.- Install VitalPBX Version 3.0 in two servers with similar characteristics.
c.- MariaDB Galera (include in VitalPBX 3).
d.- Corosync, Pacemaker, PCS and lsyncd.


We will configure in each server the IP address and the host name. Go to the web interface to: Admin>System Settinngs>Network Settings.
First, change the Hostname, remember to press the Check button.
Disable the DHCP option and set these values

IP Address192.168.10.61192.168.10.62
Primary DNS8.
Secondary DNS8.

Installing the necessary software dependencies

Install the necessary dependencies on both servers

[root@vitalpbx1-2 ~]# yum -y install corosync pacemaker pcs lsyncd

Create authorization key for the access between the two servers without credentials

Server 1

[root@vitalpbx1 ~]# ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' >/dev/null
[root@vitalpbx1 ~]# ssh-copy-id root@
Are you sure you want to continue connecting (yes/no)? yes

Server 2

[root@vitalpbx2 ~]# ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' >/dev/null
[root@vitalpbx2 ~]# ssh-copy-id root@
Are you sure you want to continue connecting (yes/no)? yes


Now copy and run the following script:

[root@vitalpbx1 ~]# mkdir /usr/share/vitalpbx/ha 
[root@vitalpbx1 ~]# cd /usr/share/vitalpbx/ha
[root@vitalpbx1 ~]# wget
[root@vitalpbx1 ~]# chmod +x
[root@vitalpbx1 ~]# ./vpbxha.s

Set these values, remember the Floating IP Mask must be 2 digit format and the Disk is that you created in the step “Create Disk”:

IP Master ......... >
IP Standby ........ >
Floating IP ....... >
Floating IP Mask... > 24
hacluster password. > mypassword

Are you sure to continue with these settings? (yes,no) > yes

Now, reboot the Server 1 and wait for status change in Server 2.

[root@vitalpbx1 ~]# reboot
[root@vitalpbx2 ~]# role

Then reboot the Server 2, connect to Server 1 and wait for status change in Server 1.

[root@vitalpbx2 ~]# reboot
[root@vitalpbx1 ~]# role


To execute the process of changing the role, we recommend using the following command:

[root@vitalpbx1 ~]# bascul
************************************************************ * Change the roles of servers in high availability * * WARNING-WARNING-WARNING-WARNING-WARNING-WARNING-WARNING * *All calls in progress will be lost and the system will be * * be in an unavailable state for a few seconds. * ************************************************************
Are you sure to switch from vitalpbx1.local to vitalpbx2.local? (yes,no) > yes

This action converts the vitalpbx1.local to Slave and vitalpbx2.local to Master. If you want to return to default do the same again.

Turn on and turn off

When you have to turn off the servers, when you turn it on always start with the Server 1, wait for the Server 1 to start and then turn on the Server 2.

Next we will show a short video how high availability works in VitalPBX

Update VitalPBX

To update VitalPBX to the latest version just follow the following steps:
1.- From your browser, go to the IP address
2.- Update VitalPBX from the interface
3.- Execute the following command in Server 1 console

[root@vitalpbx1 ~]# bascul 

4.- From your browser, go to the IP address again
5.- Update VitalPBX from the interface
6.- Execute the following command in Server 1 console

[root@vitalpbx1 ~]# bascul 

Some Useful Commands

  • bascul, is used to change roles between high availability servers. If all is well, a confirmation question should appear if we wish to execute the action.
  • role, shows the status of the current server. If all is well you should return Masters or Slaves.
  • pcs resource refresh –full, to poll all resources even if the status is unknown, enter the following command.
  • pcs cluster unstandby host, in some cases the bascul command does not finish tilting, which causes one of the servers to be in standby (stop), with this command the state is restored to normal.

CONGRATULATIONS, you have installed and tested the high availability in VitalPBX!

Also available in GitHub

To see the step-by-step manual:
Manual step-by-step

Learn more about VitalPBX, our services and how we can help you achieve your goals in our official website.

Our Latest Post

Leave a Reply