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 am going to use HAProxy as a load balancer that will balance requests on 3 application servers. But what if balancer server (HAProxy) fails at some point? I was thinking of cloning the first balancer, so if the main one fails the other will take its place. Something like HSRP.

Is it possible? if yes how?

Thanks,

share|improve this question

3 Answers 3

up vote 9 down vote accepted

This is typically done using some form of VRRP maintaining a virtual IP address across 1 or more servers, each running HAproxy.

This is typically done with keepalived, there's a guide here which should help.

Note that several people use Heartbeat for this, but Willy Tarreau (the guy behind HAproxy) has mentioned it isn't the best tool for the job. You can read more on that in this message from the HAproxy mailing list.

share|improve this answer
1  
As people say, you can using something like keepalived or heartbeat to failover to a 2nd box, but remember you need to have your config in sync too. I modified the init.d script to sync the config on restart. –  Coops Mar 1 '11 at 8:10

High availability HAProxy setup is possible with Heartbeat on Linux or CARP or BSD systems.
It requires one "floating" IP address (which will be used for HAProxy), which will be assigned to one of computers in cluster. One current computer holding IP address fails, failover server will take IP address and continue serving requests. If you combine CARP with pfsync, TCP connection state will be synced between servers and failover will be "seamless"

share|improve this answer

HSRP only works on Cisco switches and routers.

You can use uCARP(CARP protocol) or vrrpd(VRRP protocol). Requires that both HAproxy are on the same network.

If your gateway support OSPF, you can use OSPF(Quagga). You can set different OSPF interface priority. When one HAproxy fail, gateway delete it from router table.

share|improve this answer

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.