HAProxy HA VIP Pacemaker Corosync PCS

…Hello all!

I can not tell you how pleased I was to discover HAProxy. What a brilliant piece of kit!

At work I have 3 IIS servers that front a db backend. Historically the company used the MS NLB which has worked to a degree but does nothing but round robin requests with no ability to report node issues, let alone shoot them in the head!

So I was looking for a solution and came across HAProxy - now understand I am not a Linux guru, my exposure has in the past been very very limited so I have had a bit of a learning curve to do.

I have to say that ‘out of the box’ getting a single instance of HAProxy to load balance across the 3 IIS servers was surprisingly easy.

But you know how it is… I decided the better solution would be to have two instances of HAProxy in an ‘Active/Passive’ configuration to provide a good level of resilience.

I have followed a tutorial from ‘Clusters from Scratch’ which was really useful and another from Digital Ocean as well as dipping into many other resources.

As it stands at the moment I have Pacemaker / Corosync / PCS and HAProxy installed on 2 Ubuntu Servers. The cluster is up and running though I am yet to configure fencing and STONITH.

I am now stuck, probably because I’m not seeing the obvious. I have a VIP setup that the cluster uses as a resource, I now need to add HAProxy as a resource in Pacemaker, before I can I need to setup the HAProxy.cfg file.

In some of the tutorials it says that I need to bind the front end to the host IP, other resources say I need to bind the front end to the virtual IP.

Can someone please clarify this for me?

Many thanks!

Hi,

Pacemaker and Corosync makes your VIP.

You need to add HAProxy resource agent to your cluster managed resources and make your cluster with master-slave mode if you want to make active/passive model.

After that make colocation and ordering between your VIP and HAProxy cluster.

Done.

morning yes I understand that part of the process - the only thing that is not clear is when I configure the haproxy.cfg, in the front end binding do I bind to the VIP or the actual host IP of that particular haproxy host?

cheers

Yes, Bind to VIP and if you have a problem on binding to VIP, just set kernel parameter “ip_nonlocal_bind” to 1 on each hosts.

thank you - I’ll give that a go!