Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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?

share|improve this answer
    
great news! adding the subnet mask (/32) made loadb1 take the resource. However, when I simulate a failover, loadb2 doesn't take the resource. Thank you for jostling my brain to attempt that! Now, just getting loadb2 to work.... –  lilott8 Mar 2 '11 at 17:48
1  
O.K. I got it working. Apparently heartbeat on loadb2 didn't like "service heartbeat restart" I had to run: "service heartbeat stop" then "service heartbeat start" to get it to properly reload the config. Thanks for your help. –  lilott8 Mar 2 '11 at 19:04
    
Not sure how much help I was, but I'm very glad you've got it working. Good luck with it! –  MadHatter Mar 2 '11 at 22:23
    
It was the subnet mask that made it work. You helped me think to try adding the subnet mask /32 to haresources. :) –  lilott8 Mar 3 '11 at 16:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.