HAProxy + Heartbeat cluster active/active

haproxyheartbeatpacemaker

I have 2 servers running HAProxy to load balance some web servers and database servers with Heartbeat to cluster them in active/passive mode.

At the moment, if the active server dies then the passive one takes over the load balance tasks with the shared IP.

My problem is that a single HAProxy server is not enough to handle the load because the traffic is very high. I want to use 2 HAProxy servers in active/active mode.

How do I do it? Can anyone suggest a solution and examples of how to do it?

Best Answer

you can start to trying to use the ip address of your service in pacemaker with:

primitive ClusterIP ocf:heartbeat:IPaddr2 \ 
        params ip="192.168.122.101" cidr_netmask="32" clusterip_hash="sourceip" \
        op monitor interval="30s"

and your haproxy need to be clone, you can find more information about active/active configuration in http://clusterlabs.org/doc/en-US/Pacemaker/1.1-plugin/html/Clusters_from_Scratch/ch08s05.html