Installing heart beat on opensips /openser server


SERVER 1

Install heart beat from aptitude issing following command
apt-get install heartbeat

cd to installation folder e.g /etc/heartbeat
create or edit a file with following parameters
# Heartbeat logging configuration
logfacility daemon

# enabeld logging deamon
use_logd on

# If this is set to none set nodes below using node hostname
autojoin none

# Heartbeat cluster members
node opensipserver1(opensipserver1 hostname alias)
node opensipserver2(opensipserver2 hostname alias )

# Heartbeat communication timing
keepalive 1
warntime 2
deadtime 3
initdead 10

# Heartbeat communication paths
udpport 694
ucast eth1 192.168.1.90 (local private ip address of server 1)
ucast eth1 192.168.1.90 (local private ip address of server 1)
ucast eth0 202.70.xxx.xxx (public ip address of server 2)
ucast eth0 202.70.xxx.xxx (public ip address of server 2)

# Don't fail back automatically
auto_failback on

# Monitoring of network connection to default gateway.. or the other machine incase ther eis only two
ping 202.70.xxx.xxx (public ip address of server 2)
respawn hacluster /usr/lib/heartbeat/ipfail
create or edit file haresources and add the following lines
opensernode1 IPaddr::202.xxx.xxx.83/24/eth0
opensernode1 IPaddr::202.xxx.xxx.84/24/eth0
opensernode1 IPaddr::202.xxx.xxx.85/24/eth0
opensernode1 IPaddr::202.xxx.xxx.86/24/eth0
opensernode1 IPaddr::202.xxx.xxx.87/24/eth0
opensernode1 IPaddr::202.xxx.xxx.88/24/eth0 opensips
where opensernode1 is the hostname alias of Server 1 and 202.xxx.xxx.83...88 are the heart beat ipaddresses. Also opensips on the bottom line is the service to start.

NOTE : We have Opensernode1 in haresources file because its our primary heart beat server.

Execute the following script which will create authkeys file with key hash on the same folder
cat <<-!AUTH >/etc/ha.d/authkeys
# Automatically generated authkeys file
auth 1
1 sha1 `dd if=/dev/urandom count=4 2>/dev/null | md5sum | cut -c1-32`
!AUTH
Output :- # Automatically generated authkeys file

auth 1

1 sha1 15dsdsse5192ad322246a61c475sddsefbs

SERVER 2

Install heart beat from aptitude issing following command
apt-get install heartbeat
cd to installation folder e.g /etc/heartbeat
create or edit a file with following parameters
# Heartbeat logging configuration
logfacility daemon

# enabeld logging deamon
use_logd on

# If this is set to none set nodes below using node hostname
autojoin none

# Heartbeat cluster members
node opensipserver1(opensipserver1 hostname alias)
node opensipserver2(opensipserver2 hostname alias )

# Heartbeat communication timing
keepalive 1
warntime 2
deadtime 3
initdead 10

# Heartbeat communication paths
udpport 694
ucast eth1 192.168.1.89 (local private ip address of server 2)
ucast eth1 192.168.1.89 (local private ip address of server 2)
ucast eth0 202.70.xxx.xxx (public ip address of server 1)
ucast eth0 202.70.xxx.xxx (public ip address of server 1)

# Don't fail back automatically
auto_failback on

# Monitoring of network connection to default gateway.. or the other machine incase ther eis only two
ping 202.70.xxx.xxx (public ip address of server 1)
respawn hacluster /usr/lib/heartbeat/ipfail

create or edit file haresources and add the following lines
opensernode1 IPaddr::202.xxx.xxx.83/24/eth0
opensernode1 IPaddr::202.xxx.xxx.84/24/eth0
opensernode1 IPaddr::202.xxx.xxx.85/24/eth0
opensernode1 IPaddr::202.xxx.xxx.86/24/eth0
opensernode1 IPaddr::202.xxx.xxx.87/24/eth0
opensernode1 IPaddr::202.xxx.xxx.88/24/eth0 opensips
where opensernode1 is the hostname alias of Server 1 and 202.70.xxx.83...88 are the heart beat ipaddresses. Also opensips on the bottom line is the service to start.
Copy the same authkeys from Server 1 and paste it here on authkeys file
Start heart beat in both servers and you should be good to go.

Comments are closed.