Currently I have a system where I have installed HAProxy on one machine and my other 3 machines serves the webapps and the fourth machine for the database. Now I need to add another load balancer in my system so that any one of the load balancer could pick the request and process it.

But I don't understand how exactly are we going to configure a second load balancer if my domain say example.com is pointing to the IP address which is the load balancer currently. When I add a second load balancer

  1. Will there be any third machine where something needs to be installed so that it can redirect the request to one of my load balancer? Again if this is so, it again is a single point of failure and creates a bottle neck.

  2. If at all I am going to have 2 machines running load balancers then how exactly is the request going to come in because both machines will anyway have different IP.

  • AFAIK there are two solutions. 1) You could use a Level 3 Load Balancer then you had another machine and a single point of failure. 2) You could use DNS-Load-Balancing. If it is an option for you, you could use a cloud vendor like AWS, Azure or Google and therefore dont have to worry about this anymore.
    – Darem
    Oct 21, 2021 at 6:08
  • is there any option apart from the cloud vendors, and having my own thing? I want to setup everything of my own and free/open source(budget problem you know) Oct 21, 2021 at 6:11
  • But if I set up it at DNS level, how are we going to stick the sessions? say client A made a request it went to loadbalancer1, clientA again made a request it went to loadbalancer2. If it was only one load balancer then it knew how to stick the client to one server but now we have 2 load balancer which work independently Oct 21, 2021 at 6:23
  • The first two options can be done without any cloud vendor on your own. Regarding your second question. When you do DNS Load Balancing a client will use the same IP for continuous HTTP calls. Because the DNS will be cached on the client (if not configured otherwise). And on a Level 3 Load Balancer you can configure the load balancer to route the same IP always to the same server. This is slower of course but when you need that feature you can use it.
    – Darem
    Oct 21, 2021 at 6:40
  • google "keepalived" basically you have two virtual IP addresses that can move between the machines and round robin dns
    – Ewan
    Oct 21, 2021 at 16:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.