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

I have two real servers, on different subnets, each one with a permanent IP, and with a failover IP that can be used by either server. The hoster provides an API with which I can assign the failover IP to any of the servers. So I need to run a daemon on each of the servers, which will be monitoring the health of the local server, and at the same time communicate with its counterpart at the other server, so that the two together (or only one, if the other fails) decide who will get the failover IP (and run a script to tell the hoster's API to route it appropriately).

keepalived can't do it, unless (allegedly) with Willy Tarreau's unicast patch, which I've tried unsuccessfully. In addition, it would be preferable for the daemon to not attempt to take or release the IP from the network interface; the preferred setup is for the interfaces of both machines to always have the failover IP address.

Can heartbeat do it? Can any other similar program do it? I've ended up writing my own daemon, which does work properly, but I see no reason to maintain it if an existing program can do it.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Heartbeat can do it, because it's capable of running arbitrary scripts to manage resources, so you can write a script to call the hosting provider's API to move the IP address around.

share|improve this answer
    
That is not enough. Heartbeat must also be able to communicate with unicast with its peer. Does it do that? –  Antonis Christofides Jul 5 '12 at 15:33
    
Yes, of course. –  womble Jul 5 '12 at 15:37
    
Oh, you are right. The ucast configuration option. And I remember I did see that. I've read so much my head's spinning. –  Antonis Christofides Jul 5 '12 at 15:53
    
I think it is quite difficult for a beginner to understand how the heck you can run scripts with heartbeat. But I think I'm beginning to understand this now. –  Antonis Christofides Jul 6 '12 at 14:08
1  
Yeah, it's not trivial stuff. If you want a real mind screw, use Pacemaker. Ai yai yai! –  womble Jul 6 '12 at 14:25
show 1 more comment

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.