I am experimenting with cluster of 2 linux machines (nlb0 & nlb2) using heartbeat for httpd service. Each machine has 2 eternet cards, et0 connects to public network, and et1 is connect to a local router (10.0.0.1 for nlb0, and 10.0.0.2 for nlb2)
I ran into a problem that i did not understand.
When i start a heartbeat service on nlb0,
the machine creates an alias ip, that is
et0:0 192.168.0.200 and start a httpd service.
I can access a web service from other computer with that ip (
http://192.168.0.200)
On the nlb2, i start the heartbeat service, once it starts,
the nlb2 takes over the ip et0:0 192.168.0.200.
Now, I can still access the web service of nlb0 only with
http://nlb0/index.html, but the
http://192.168.0.200 is now on nlb2.
I am confused because the nlb0 has not been down. I though the nlb2 will take the ip only when nlb0 is down.
I do more experiment by restart the heartbeat service on nlb0.
Once the heartbeat service start, the nlb0 take back the ip 192.168.0.200
Of course, nlb2 has not been down.
Can anyone help me understand the concept? The setting is below.
haresource (same for both nlb0 and nlb2)
Code:
nlb0 192.168.0.200 httpd
ha.cf (nlb2 has the same file except, "ucast eth1 10.0.0.1")
Code:
debugfile /var/log/ha-debug
logfile /var/log/ha-log
keepalive 2
deadtime 20
warntime 10
initdead 80
udpport 694
ucast eth1 10.0.0.2
auto_failback on
node nlb0
node nlb2
#
ping 192.168.0.54
respawn hacluster /usr/lib/heartbeat/ipfail