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 Linux servers (CentOS6) - both are identically configured connected to the same switch with a direct link between them. I only have one external IP that is assigned to eth0 on both servers (connected to the internet switch) with the interface shutdown on server 2.

How can I failover to server 2 if server 1 dies - as stated they are linked directly so they can check for availability of each other via ping/tcp/udp. I toyed with Heartbeat but the documentation seems to be non-existent - not sure how to bring up an interface and start some services if the other server dies.

share|improve this question

2 Answers 2

It is also possible to use Keepalived which is a VRRP implementation that sends multicast checks between the servers and if a timeout is reached it will fail over to the other server.

The configuration is pretty straight-forward and it can check for services and be used as load balancer.

Improving Network Reliability with Keepalived from linux devcenter provides some more information about the VRRP part of Keepalived.

Failover and loadbalancer using keepalived (LVS) on two machines describes more of the loadbalancer part of Keepalived and is very good for understanding a bit more of the components and usage cases.

Last but not least the manual provides some information about how to run it.

The best way to get to know Keepalived is to read the documentation on the project site.

share|improve this answer

I would use Heartbeat. The problem with the docs is that Heartbeat is now a component of Pacemaker:

http://www.clusterlabs.org/wiki/Documentation

Heartbeat is sufficient to failover an IP address, but will not detect service failures (e.g., your httpd process dies). You don't have to set up the full Pacemaker configuration if you only care about IP addresses; in that case, you can use the version 1 (Heartbeat) configuration that uses /etc/ha.d/haresources as the resource list.

share|improve this answer
    
I have Monit watching individual services so hopefully that takes care of that. I will look at that documentation and see if I can make it work. –  Lukasz Apr 2 '12 at 16:09

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.