1

When we need a high availability service (it doesn't meter what kind of service: it can be a database, a queue system, our application) we spread it info many machines to make sure when one machine is down rest of them can take this extra load.

Quite simple.

But how to spread load balancers into many machines?

A DNS record can point to 1 or few our servers. But when our server is down DNS and any client don't know that specific machine is not running. Clients will make request to it and they will get an info our web page is not working.

How to cluster load balancer layer?

Simon
  • 109
  • 2

2 Answers2

1

First, consider the complexity you are willing to take on to bring availability above a single load balanancer box. Load is generally not a problem, a single host can hand off a very high number of connections.

Load balancers can be clustered like anything else, addressing hardware or other node failures. An open source example would be haproxy with VRRP based keepalived. Typical of several local HA designs it requires same layer 2. Which means alternate solutions on clouds that only give you layer 3.

Layer 2 doesn't help the Internet from getting to a healthy node, or if your data center goes offline. That implies being clever in DNS or IP routing.

DNS can return a different record based on an automatic health check or manually. However, clients can cache results for multiple hours, which is too long for many recovery objectives.

Directing the same IP on a different path is a routing problem. Announce a route to the working load balancer.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
0

See HAPROXY or similar load/balance haproxy

ADD to response question:

Ok, yo need only one DNS record

client <-> HAPROXY <-> server A <-> server B

HAPROXY is on middle of client a servers.

HAPROXY config like

bind *:80

        acl host_mysite hdr(host) -i mysite.com
        use_backend mysite if host_mysite


backend mysite
    mode http 
    balance roundrobin
    option httpclose
    option forwardfor
    server  serverA ip:port check inter 2000
    server  serverB ip:port check inter 2000
asterissco
  • 46
  • 6
  • I know about load balanced solutions. I'm wondering how does it work when you have 2 LB servers. How does it work with DNS records? And how does it work when 1 one them is down? How to proxy the whole traffic to the second LB server? – Simon Nov 11 '19 at 11:10
  • Ok, yo need only one DNS record client <-> HAPROXY – asterissco Nov 11 '19 at 11:32