Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
up vote 10 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
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


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.