Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We utilize heartbeat for High Availability. I'd like to add an additional ip address to the heartbeat cluster, but I don't want to do a full restart of the cluster in the process. Is there a signal I can send to heartbeat that would prompt it to re-parse the "haresources" file and action upon it? heartbeat -r does not appear to do the trick.

share|improve this question

2 Answers

up vote 5 down vote accepted

The problem was that I didn't wait long enough after executing "heartbeat -r" (the command that is executed in the init.d script when you run "service heartbeat reload".) After a few minutes, the IP showed up on the interface as expected.

share|improve this answer
Heartbeat applies the change itself eh? That actually has a very low suck quotient! If you find out how long it takes let us know :-) – voretaq7 Feb 17 '12 at 19:23
I realized after reading this comment that it was rather misleading; I nuked the entire answer and re-wrote it. – Peter Grace Feb 17 '12 at 20:43
mmh, that is more sensible -- You have to trigger the reload, but it isn't instant. (And it's more deterministic, which makes me happy.) – voretaq7 Feb 17 '12 at 20:44

You don't need to reload Heartbeat at all. Simply add the new IPaddr resource to your haresources file, something like this

IPaddr::xx.xx.xx.xx

and then start it

/etc/ha.d/resource.d/IPaddr xx.xx.xx.xx start

Of course, you should make sure to issue the IPaddr start on the active node. You should now be able to send and receive traffic on the just added IP address.

share|improve this answer
I'm going to hold off on accepting my own answer as correct, since even though what I did worked, your suggestion sounds considerably more elegant. I want to try it out, but if it works, upvote and accepted answer shall be yours. – Peter Grace Feb 20 '12 at 14:20
OK, here's the deal. I tried this and low and behold, it worked! The problem is that doing this without reloading heartbeat would leave the cluster in an inconsistent state. I checked the source, and there's only three places where heartbeat reparses the haresources file, and all three of those conditions are during a requested restart. As such, if a cluster were to failover and failback, the ip you put in haresources, and manually instantiated with IPaddr <x> start, would not be recreated in the failover. Feel free to prove me wrong, but it appears this method is dangerous to rely upon. – Peter Grace Feb 20 '12 at 17:28
Quite right, Heartbeat does not keep the configuration files (eg haresources) in sync for you --you have to devise your own method. In my environment, we typically use unison for this, and it seems to work well. The haresources file is not cached, and is thus read anew when it needs to be read. Any entries in haresources will be started on restart events (or events that cause haresources to be read); this includes failover. – Kendall Feb 20 '12 at 17:39

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.