Hi,
Le 2018-11-28 06:31, Gold Star a écrit :
We use HAProxy for HTTP load balancing in our company. We run HAProxy
inside a docker container. We would like to run multiple HAProxy
containers for High Availability. In particular, we would like to:
* run say, 10 HAProxy containers (1 HAProxy per container) to handle
the incoming traffic to our company
* have each of them be active (i.e. each of them processes roughly
one-tenth of traffic)
* if one of the containers goes down, the remaining HAProxy instances
should quickly and seamlessly take over the traffic share of the
downed HAProxy
Part of what you are trying to achieve here is not related to HAProxy in
itself.
I mean that scaling horizontally your HAProxy load balancers, which I
assume to act at layer 7, is something related to the design of your
deployment. To reach that you may need to have something like another LB
in front of them which act at layer 4 and pass the traffic to your
HAProxy LBs. Another way to get it scale horizontally is to have each
HAProxy announcing its service IP to your gateways with tools like
Exabgp.
Vincent Bernat has a really good and well written article on its blog
concerning this:
https://vincent.bernat.ch/en/blog/2018-multi-tier-loadbalancer
The other thing to take care is the way your HAProxy get their
configurations (frontend and backend declarations and LB
configurations). I'm not aware of any configuration sync mechanism in
HAProxy directly, others on the list may have more informations, and so
it's something which is related to the way you are doing service
discovery and may so be more related to the container orchestration you
are using (k8s, swarm, or whatever you use to automate configuration
distribution).
In short, to scale your HAProxy in multiple Active LB, you'll need (at
least):
- something at layer 4 in front of it (LB or BGP annouces or whatever
you find interesting)
- to take care of service discovery or to sync your configurations
programmatically
HTH,
Raphaël