4

Consider that there are two server Load Balancers working in TCP proxy mode (e.g., for L7 Load Balancing). Is it possible to synchronize their states in real time so that they can be a backup for each other?

In case that one is down, the other still has all necessary states to uninterruptedly support all existing TCP connections.

I understand that this is hard, but I am wondering whether any free/commercial LB already supports this feature.

Thank you!

Pau Garcia
  • 56
  • 8
Song
  • 41
  • 1
  • 2
  • But what's the purpose of it ? Most www connections are short-lived ? And what you benefit from tcp connection if upper protocol (like http) state is not preserved. Say in the middle of large download server1 yikes, you route the tcp to server2, but it'll send nothing over that tcp ? - Or you need it for some specific application ? – Sandman4 Nov 08 '11 at 19:43
  • Sorry for my late response. I am considering the case where server1 is still working but LB1 is down. In this case, is it possible for another LB, say LB2, to support the existing TCP connections of server1? For example, when these TCP connections are for video streaming or for shopping/banking/medical applications, if LB1 is down, it is better to have another LB2 to uninterruptedly support the existing TCP connections on LB1. Thanks! – Song Nov 14 '11 at 14:47
  • Maybe just do it layer 3 ? – Sandman4 Nov 15 '11 at 16:36

2 Answers2

4

You can use the stick-table replication that we added to HAproxy for use in the Loadbalacer.org appliance.

Here is an example config: (the important bit is the peers section)

# HAProxy configuration file generated by loadbalancer.org appliance
global
    daemon
    stats socket /var/run/haproxy.stat mode 600 level admin
    pidfile /var/run/haproxy.pid
    log /dev/log local4
    maxconn 40000
    ulimit-n 81000
    tune.bufsize 16384
    tune.maxrewrite 1024

defaults
    mode http
    balance roundrobin
    timeout connect 4000
    timeout client 42000
    timeout server 43000
    log global

peers loadbalancer_replication
    peer lbmaster 192.168.67.28:7778
    peer lbslave 192.168.67.29:7778
    listen VIP_Name
    bind 192.168.67.30:80

You will also need to change the way that you start HAProxy: Check out the detailed documentation on peers: http://haproxy.1wt.eu/download/1.5/doc/configuration.txt

Bear in mind that failover still won't be totally seamless, but your stick tables will hold the correct destination server when you have a fail over.

Song Lim
  • 103
  • 4
1

You can use the Linux Virtual Server (LVS) framework that is present in the Linux kernel. http://www.linuxvirtualserver.org/index.html

It supports TCP connection synchronization for transparent load balancer failover. http://www.linuxvirtualserver.org/docs/sync.html

You can use KeepAliveD to configure both the load balancer (LVS) behavior and the failover (VRRP) behavior with connection synchronization. https://www.keepalived.org/

Tiago TT
  • 21
  • 1