Connecting HAproxy load-balancer to WAN and LAN

haproxyload balancingnetworking

I'm setting up a load balancer with failover and I'm confused on how to properly set it up. The load-balancer is balancing web traffic to web-servers on a LAN network.

My setup is the following:

I have one incoming external IP address, that ethernet cable goes to a switch. One output from the switch is going to load_balancer_1 and the second output going to load_balancer_2. Then there is heartbeat between the two load-balancers using a dedicated ethernet cable between the two computers. And finally there is a third ethernet cable which connects the load balancer to a LAN switch. And that LAN switch is connected to the web-servers.

So I need 3 ethernet ports on both load-balancers? Is this the best setup for HA load-balancing? And I'm using HAproxy

Best Answer

This is a great set up.

Using a dedicated interface for the fail-over syncing and monitoring is a good step. You want to be able to have both WAN interfaces see each other, both LAN interfaces see each other and a dedicated fail-over & sync interface, like you have, for an optimal HA solution.

I have set this up before with HAProxy and keepalived for (VRRP) IP failover. It works just dandy.