Heartbeat takes care of dead node detection, and service/resource migration.
Heartbeat clusters can be ridiculously simple or complex. We will cover setting
up a simple cluster. To learn more about heartbeat, and how to setup even more
complex setups see the
I this HOWTO we are assuming that you have 2 nodes (cluster1 and cluster2) with ip addresses (192.168.0.1 and 192.168.0.2 respectively), and you will have one cluster ip (192.168.0.5).
To install heartbeat, just use
# emerge heartbeat
This should complete without any problems, but if there are any report them via
Edit
bcast eth0 keepalive 2 warntime 10 deadtime 30 auto_failback off node cluster1 node cluster2
if you are going to be using a serial cable as a heartbeat transport, add the following settings as well:
serial /dev/ttyS0 baud 19200
Now what do these settings mean?
Setting | Description |
---|---|
Other possible settings are:
Setting | Description |
---|---|
Now edit
You only need the following line (edit nodenames/IP addresses accordingly):
cluster1 192.168.0.5
This will give you an IP that moves to cluster2 when cluster1 dies.
Edit the
1 sha1 key-for-sha1-any-text-you-want
# /etc/init.d/heartbeat start
You can pull the plug on cluster1 to test failover, or you can just shutdown heartbeat on cluster1, and watch as your cluster ip migrates to the other node.