Comments on Setting Up A High-Availability Load Balancer (With Failover and Session Support) With HAProxy/Keepalived On Debian Etch

Setting Up A High-Availability Load Balancer (With Failover and Session Support) With HAProxy/Keepalived On Debian Etch This article explains how to set up a two-node load balancer in an active/passive configuration with HAProxy and keepalived on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using keepalived, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. HAProxy is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.).

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By:

I wonder what's the point in using HAProxy? Whereas everything can be done with Keepalived only!

 

 virtual_server 192.168.0.99 80 {
    delay_loop 10
    lb_algo wlc
    protocol TCP
    lb_kind TUN

    real_server 192.168.0.102 80 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
        }
    }

    real_server 192.168.0.103 80 {
        weight 1
        TCP_CHECK {
            connect_timeout 5
        }
    }

}

 

For sessions can be added 'persistence_timeout' or (which is much better) - sharedance.

 

By: Malcolm Turnbull

Keepalive integrates well with LVS a great layer 4 solution, but HaProxy is far more flexible as it runs at layer 7 and can do full cookie insertion etc. Many loadbalancing hardware vendors such as Barraccuda, Kemp, ClusterScale, WebMux & Loadbalancer.org use LVS for its high performance. Many use custom proxies for cookie insertion. My company www.Loadbalancer.org uses HaProxy we also provide full root access and source code + 24*7 support.. excuse the shameless plug.

BTW. very nicely written, apache logging config is useful. 

By: Multi vendor shopping cart

Supporting tens of thousands of connections is clearly realistic with today's hardware. Its mode of operation makes its integration into existing architectures very easy and risk less, while still offering the possibility not to expose fragile web servers to the Net.

By: ivelclown

Hi guys,
Can I use ubuntu as load balancer/ HA proxy?
  

 

 

By: Jasper Sudario

On LB2 keepalived.conf, the state should be set to SLAVE instead of MASTER, right?