Pacemaker load-balancing with Clone
Introducing the load-balancing feature with Pacemaker.
Pacemaker allows you to perform load-balancing mecanism thanks to the IPaddr2 resource agent. The point here is to set a virtual IP and make it available in an active/active mode with the help of pacemaker clone.
$ sudo crm configure primitive p_vip ocf:heartbeat:IPaddr2 \
What about this
clusterip_hash parameter? Specify the hashing algorithm used for the Cluster IP functionality. This parameter is optional by default and the default value is
sourceip-sourceport. The CLUSTERIP target is used to create simple clusters of nodes answering to the same IP and MAC address in a round robin fashion.
This will create the following IPTABLES rule:
Chain INPUT (policy ACCEPT 27879 packets, 6604K bytes) pkts bytes target prot opt in out source destination 0 0 CLUSTERIP all -- eth0 any anywhere 172.17.1.100 CLUSTERIP hashmode=sourceip clustermac=61:0E:45:64:50:A7 total_nodes=2 local_node=2 hash_init=0
clustermac is automatically generated by the RA.
If you want to learn more about the CLUSTERIP target read that link.
Set up your clone:
$ sudo crm configure clone clo_vip p_vip \
If you want to learn more about the
interleave parameter look at the Hastexo article.
Test it, for this purpose you will need to ping the VIP from several client sources and each pacemaker node where the clone runs, execute the following command:
$ sudo tcpdump -i eth0 'icmp[icmptype] = icmp-echoreply'
Sometime this solution could be useful but at the end it doesn’t replace a ‘real’ load-balancer like LVS.