Linux – Heartbeat not taking its resource

heartbeathigh-availabilitylinux

So I have heartbeat installed, I followed a config guide where I literally changed the IP's of the guide and it's not working as it should :(.

The reason the eth numbers are obviously different. I don't think that should have any effect on the resource handling though. I used uname -n for the node names. I have placed their ip's in the /etc/hosts file so they know about each other.

There is nothing suspicious in the logs. Also Apache is set to listen on any interface available.

I cannot ping or reach the shared resource at all. Any Ideas?

Here are my configs on my two servers that are running heartbeat. They are aptly named loadb1 (192.168.1.101) and loadb2 (192.168.1.102) and their shared resource: 192.168.1.100.

Loadb1's configs are:

ha.cf

logfile /var/log/ha-log
bcast eth0
keepalive 2
warntime 10
deadtime 30
initdead 120
udpport 694
udp eth0
auto_failback yes
node loadb1
node loadb2
#uuidfrom nodename
#respawn hacluster /usr/lib/heartbeat/ipfail

haresources

loadb1 IPaddr::192.168.1.100 httpd

authkeys (which is set to 600)

auth 2
2 crc

Loadb2's configs are:

ha.cf

logfile /var/log/ha-log
bcast eth1
keepalive 2
warntime 10
deadtime 30
initdead 120
udpport 694
udp eth1
auto_failback yes
node loadb1
node loadb2
#uuidfrom nodename
#respawn hacluster /usr/lib/heartbeat/ipfail

haresources

loadb1 IPaddr::192.168.1.100 httpd

authkeys (which is set to 600)

auth 2
2 crc

When I run "service heartbeat status", I get:

heartbeat OK [pid xxxx et al] is running on loadb[x] [loadb[x]]...

depending on which server I'm on it will read loadb1 or loadb2

Best Answer

In haresources, try specifying the interface you want to have the shared address:

loadb1  192.168.1.100/24/eth0 httpd

or /eth1 as appropriate (the /24/ specifies the netmask, change that if appropriate). If you do that, restart both HA processes, and it's still not working, can we get the output of ifconfig -a on both servers?

Edit: ah, that's probably not such a good idea. This page says that

Note that it is absolutely mandatory for the haresources files to be identical on both machines.

so you mustn't say /eth0 on one machine, and /eth1 on the other. May we ask why one machine uses eth0 and the other eth1, and if there's any way of changing it? And can we get the output of ifconfig -a, please?