Kamailio high availability building

Kamailio is an important part in sip service. There are also many schemes for the construction of high availability in kamailio. In centos7, this paper adopts the method of virtual ip drift keepalived plus sipsak. This can ensure that after one machine dies, another machine can continue to process business with the drift of virtual IP; On the other hand, if both machines are not down and only kamailio hangs up, you can also make the virtual ip drift through sipsak's health check to avoid the situation that only kamailio hangs up, the machine is still keepalived, and then the virtual IP does not drift;

Open source library used: keepalived+sipsak

Keep the installation active Compile the installation script:

Keep some related operations:

Sipsak compilation and installation:

The main service is configured with keepalived.conf, which is located in the /etc/keepalived/ directory by default:

Node0 1.sh script content:

The standby service is configured with keepalived.conf, which is located in the /etc/keepalived/ directory by default:

Node02.sh script content: