Now you need to tell the heartbeat daemons that you want them to use the new Ethernet network (or the Ethernet crossover or serial cable) to send and receive heartbeat packets.
Find the ha.cf sample configuration file that the Heartbeat RPM installed by using this command:
#rpm -qd heartbeat | grep ha.cf
Copy the sample configuration file into place with this command:
#cp /usr/share/doc/packages/heartbeat/ha.cf /etc/ha.d/
Edit the /etc/ha.d/ha.cf file, and uncomment these lines:
#udpport 694 #bcast eth0 # Linux
Note | Older versions of Heartbeat use udp instead of bcast. |
For example, to use eth1 to send heartbeat messages between your primary and backup server, the second line would look like this:
bcast eth1
If you use two physical network connections to carry heartbeats, change the second line to this:
bcast eth0 eth1
If you use a serial connection and an Ethernet connection, uncomment the lines for serial Heartbeat communication:
serial /dev/ttyS0 baud 19200
Also, uncomment the keepalive, deadtime, and initdead lines so that they look like this:
keepalive 2 deadtime 30 initdead 120
The initdead line specifies that after the heartbeat daemon first starts, it should wait 120 seconds before starting any resources on the primary server, or making any assumptions that something has gone wrong on the backup server. The keepalive line specifies how many seconds there should be between heartbeats (status messages, which were described in Chapter 6), and the deadtime line specifies how long the backup server will wait without receiving a heartbeat from the primary server before assuming something has gone wrong. If you change these numbers, Heartbeat may send warning messages that indicate that you have set the values improperly (for example, you might set a deadtime too close to the keepalive time to ensure a safe configuration).
Add the following two lines to the end of the /etc/ha.d/ha.cf file:
node primary.mydomain.com node backup.mydomain.com
Or, you can use one line for both nodes with an entry like this:
node primary.mydomain.com backup.mydomain.com
The primary.mydomain.com and backup.mydomain.com entries should be replaced with the names you have assigned to your two hosts when you installed Linux on them (as returned by the uname -n command).
The host names of the primary and backup servers are not usually related to any of the services offered by the servers. For example, the host name of your primary server might be primary.mydomain.com, even though it will host a web server called mystuff.mydomain.com.
Note | On Red Hat systems, the host name is specified in the /etc/sysconfig/network file using the hostname variable, and it is set at boot time (though it can be changed on a running system by using the hostname command). |