0

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?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Phong Đặng
  • 53
  • 1
  • 5
  • I solved this using this resource agent https://raw.githubusercontent.com/russki/cluster-agents/master/haproxy and binding every haproxy resource to a dedicated virtual ip https://www.sebastien-han.fr/blog/2012/04/19/active-passive-failover-cluster-on-a-mysql-galera-cluster-with-haproxy-custom-ocf-agent/ – c4f4t0r Sep 12 '18 at 15:12
  • One word of warning that might be relevant: If your load is too high on a single node in a two node cluster to handle your traffic, switching to active/active to handle that load degrades the possibility of HA significantly if not sometimes completely. If you can't lose a node without overloading your remaining nodes, you no longer have an HA cluster. Adding a third node and using a 2n clone resource gets around this nicely. – Spooler Sep 12 '18 at 15:47
  • If your load is so high, you should have at least enough nodes to sustain a single failure as @Spooler warned about. Keep in mind that all incoming initial traffic hits all nodes, too anyway. Might be time to look into DNS round-robin across two or more HA clusters. – namezero Oct 28 '18 at 18:20

1 Answers1

-1

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

c4f4t0r
  • 5,301
  • 3
  • 31
  • 42