I'm in the process of coming up with a highly available Apache / MySql group of virtual servers using HAProxy Reverse Proxy & Keepalive.

I'm aware that I'm going to be using a floating public ip, then configuring HAProxy to relay traffic to the servers in the configuration file.

As far as I understand, all server instances need to be on the same network, this is a problem as if the datacenter does down, the group of servers fails. How can I create a highly available setup that does not require all virtual servers to be under one single network. I assume the problem will lie on the floating ip and HAProxy.

For example:

2 servers on Digital Ocean 2 servers on Linode 2 servers on aws

Digital Ocean specifies on this page "Both servers must be located within the same datacenter and should have private networking enabled."

They are using keepalive.

2 Answers 2


The normal way to handle multi-site fail over is to have a pair of load balancers on site A in a master/slave fail over config. Then put an identical pair on the remote site.

If ALL the backend servers on site A fail then use the public VIP on site B as the fallback (high latencey of course across the WAN)... But back this up with a proper DNS based load balancing services such as Amazon route 53 (which has health checking and fail over) , So that fairly quickly no traffic would go to site A anyway.

If you have a really fast stretched VLAN across two sites with the same IP scheme then you can do it with just a single pair of load balancers.

But it sounds like you should just forget HAProxy and use Amazon Route 53 for the whole lot? (unless you have persistence issues.)

  • I'll look into Amazon Route 53, sounds like it should work perfectly as solution for multi-site. I really don't need load balancing, but high availability, your solution nails it. Thanks for the explanation. You're right, there will be latency across the WAN. I wonder how the big guys achieve high availability across many data center / sites / clustering, etc.
    – codex73
    Jun 10, 2016 at 19:33

you can also "simulate" the local network by doing iptables redirect from a local machine to remote cloud.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .