Wait for one backend to be UP before allowing connections to another backend


#1

I am trying to work out how it is possible to wait for one backend to be available (UP) before allowing connections to another backend.
I am using Ubuntu 16.04, haproxy version 1.6.3-1ubuntu0.1 .

I have 2 frontends and 2 backends configured. One is for a web service (REST Calls etc to a Wildfly Server) and the other is for a messaging broker (ActiveMQ). The ActiveMQ backend is up before the Web Service frontend. Unfortunately due to items out of my control the WebService and Active MQ are on the Same machine and linked. What I would like to achieve is for the WebService Backend Server A to be UP before HAProxy allows connections to the ActiveMQ Backend Server A.


#2

Hello

Did you found a solution? I’m having similar problems and didn’t find a solution yet…

Thanks


#3

phinel. Unfortunately I did not find a solution to my problem using HAProxy. I was limited by the amount of time I had to configure this solution. Whilst I was exploring the HAProxy solution I was also looking at using VRRP (via keepalived) to migrate IP Addresses between my Virtual Machines. As I did not require the Load balancing portion of HAProxy, it was easier in my situation to configure keepalived as the High Availability solution.


#4

Not via internal methods, but you can always use external checks:
http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#option%20external-check

Or agent-check:
http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#5.2-agent-check

So you build your own check script, where you can helth checking anything you like.