Is there a way to force heartbeat to add new ip addresses to the system without a full restart?

6,816

Solution 1

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.

Solution 2

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:
6,816

Related videos on Youtube

Peter Grace
Author by

Peter Grace

Updated on September 18, 2022

Comments

  • Peter Grace
    Peter Grace almost 2 years

    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.

  • voretaq7
    voretaq7 over 12 years
    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
    voretaq7 over 12 years
    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.)
  • Peter Grace
    Peter Grace over 12 years
    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
    Peter Grace over 12 years
    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.
  • Kendall
    Kendall over 12 years
    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.