Discussion:
HA setup for HAProxy
Gold Star
2018-11-28 05:31:30 UTC
Permalink
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

How can we achieve this?

Thanks!
Raphaël Enrici
2018-11-28 07:08:19 UTC
Permalink
Hi,
Post by Gold Star
We use HAProxy for HTTP load balancing in our company. We run HAProxy
inside a docker container. We would like to run multiple HAProxy
* 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
Gibson, Brian (IMS)
2018-11-28 11:17:06 UTC
Permalink
I either use openshift or if not using docker I use keepalive. There is plenty of documentation out on the internet in how to use either of these solutions.

Sent from Nine<http://www.9folders.com/>
________________________________
From: Gold Star <***@gmail.com>
Sent: Wednesday, November 28, 2018 12:33 AM
To: HAProxy
Subject: HA setup for HAProxy

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

How can we achieve this?

Thanks!


________________________________

Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.
Loading...