Friday, February 6, 2015

high availability - Linux Virtual IP Options



There seem to be lots of options in Linux to provide a virtual IP for failover between multiple hosts. Some that I have found are heartbeat, vrrpd, carp, and keepalived.



In Linux I only have experience with heartbeat (and have used HSRP in Cisco). Do these various options have any particular advantage when it comes to providing a virtual IP that will be a gateway for hosts on the LAN. One feature I would like to have is the ability to track another interface. So for example if the virtual IP is shared between eth0 on Server A and eth0 on Server B, I would like to have it be able to failover to another server if it detects eth1 has gone down. I would also like to be able to set a preferred host.



Answer



One of the primary advantages I have found with heartbeat has been the ability to customize it to have multiple monitoring points. As per the default recommended configuration, it has multiple monitoring points between the serial uplink and the network monitoring.



For example, a heartbeat resource script could be created to monitor a daemon and in case of the daemon failing, initiate a failover.



CARP is based on HSRP, which as you identified monitors the interface. This certainly has a place and I like the technology but depending upon the server role you might find heartbeat to be advantageous.



I suppose it could be argued that even those protocols that do not support this could have a script written to imitate some of the behavior, which is essentially what I described with heartbeat.



While I have never used keepalived, it seems to be similar to ldirectord in that it monitors LVS hosts and removes them from the VIP in case of failure. I would not consider this to be in the exact same category as heartbeat or CARP.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...