Howto setup 3-node heartbeat cluster

heartbeatheartbeat3high-availability

I want to set up a virtual IP on three nodes using heartbeat. Currently, I have this:

ha.cf:

#       Facility to use for syslog()/logger (alternative to log/debugfile)
logfacility     local0

#       keepalive: how many seconds between heartbeats
keepalive 2

#       deadtime: seconds-to-declare-host-dead
deadtime 10

#       What UDP port to use for udp or ppp-udp communication?
udpport        694

#   What interfaces to broadcast heartbeats over?
ucast  eth0 192.168.20.22
ucast  eth0 192.168.20.23
ucast  eth0 192.168.20.24

#       What interfaces to heartbeat over?
udp     eth0

#       Tell what machines are in the cluster
#       node    nodename ...    -- must match uname -n
node    prx2
node    prx3
node    prx4

haresources:

prx2 192.168.20.25

When I start the machines, prx2 gets the virtual IP. But when I shut down prx2, both prx3 and prx4 acquire the virtual IP, which means that my service is not reachable any more.

What am I doing wrong?

PS: I'm on Debian Squeeze

Best Answer

I'm sorry that I don't have an answer for your particular question but from my experience I'd suggest using Pacemaker which is the successor of Heartbeat which is a dead project.

Take a look here: http://clusterlabs.org/