0

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

andreas-h
  • 1,114
  • 1
  • 17
  • 28

1 Answers1

1

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/

Kai Bojens
  • 158
  • 3
  • Actually, this can be read on the Linux-HA's [**Pacemaker** wiki page](http://www.linux-ha.org/wiki/Pacemaker): _"Heartbeat originally came with a primitive resource manager, however this is only capable of managing 2 nodes [...]"_, where the _primitive resource manager_ refers to `haresources`. – Lukas Mar 13 '13 at 19:23
  • @Lukas I think that information on the wiki page refers to a very old Heartbeat version, because right after the passage you cite, it says "A new resource manager which addressed these limitations and more was written for Heartbeat 2.0.0." And Heartbeat 3.0 is the recent version. – andreas-h Mar 14 '13 at 10:41
  • @andreas-h The _new resource manager ... for Heartbeat 2.0.0_ was spun-off (taken out of the project to become independent) and is now called **Pacemaker**. Also @kai-bojens: Pacemaker is **not** a replacement for **Heartbeat** (which is not _dead_, but considered stable) but for its CRM (Cluster Resource Manager). When Pacemaker is installed on the system, have a look at [Heartbeat's `crm` config directive](http://linux-ha.org/wiki/Ha.cf#crm_-_enabling_and_disabling_the_Pacemaker_cluster_manager). – Lukas Mar 14 '13 at 16:30