I am trying to load balance a load balancer (HAProxy). Meaning i want to create a load balancer cluster/farm.
The farm would use different bindings/rules to load balance requests differently based on the rules to several other clusters with different purposes.
I cant seem to find much info on the topic, all i find is active-passive setups with just 2 instances... I need to plan for many of them, not only 2. Then I came accross this post: http://www.serverphorums.com/read.php?10,672865
which mentions:
HAProxy can share as of 1.5 its connection table, which is really a appreciated feature :)
I plan to use a Firewall with load balancing capabilities (Fortinet) to balance requests to active HAProxy instances which then in turn would load balance the requests accordingly.
So Is there a way that the connection table can be shared amongst the instances so that I can achieve true active/active load balance of the HAProxy itself?
Is there a better way?
So you need a contingency for your HAproxy?
You should use a floating IP, and it depends on your cloud infrastructure (may you need the help of your hosting provider).
That's the only way to break-out of the point of failure of a single load balancer:
Image source: digital ocean
If the primary load balancer down, a secondary will automatically assume to keep serving requests.
It is important to note that the Floating IP does not automatically provide high availability by itself; a fail-over mechanism, which automates the process of detecting failures of the active server and reassigning the Floating IP to the passive server, must be devised and implemented for the setup to be considered highly available. There are some open-source solutions to fit this necessity such as http://www.keepalived.org that provides failover capabilities if the primary load balancer becomes unavailable.
May this article could help: https://www.digitalocean.com/community/tutorials/how-to-set-up-highly-available-haproxy-servers-with-keepalived-and-floating-ips-on-ubuntu-14-04