Is there a way to have haproxy send a per-server argument during a
health-check?  Right now, I do "server A check addr localhost 9000"
and "server B check addr localhost 9001" and so on, and have xinetd
monitor 9000/TCP and 9001/TCP.  When haproxy connects to those, xinetd
in turn runs a health-check script I wrote that actually does the
checking.  When done checking the script returns either HTTP200 or
HTTP500 depending on if it's good or not.

This means I start using one port per back-end server.  If I have 10
server that haproxy spreads the load across, I have "server ... 9002"
and "server ... 9003" and so on through 9009.  I then have 10
different copies of my little script, each of which just connects to a
different server (A, B, C...) and does the check.

If haproxy could do something like "server A check addr localhost 9000
argument A", I could have only one port watched by xinetd, and only
one copy of the script, that would simply accept "A" as an argument of
the server it should check.

I use option httpchk with the above (all in the same "listen" group).
But I wasn't sure if I could change option httpchk for every server.
Could I do a:
listen farm address:port
   balance roundrobin
   mode tcp
   option httpchk GET 1
   server A 1.1.1.1:389 check addr localhost port 9000 inter 5s
fastinter 1s downinter 120s
   option httpchk GET 2
   server B 1.1.1.2:389 check addr localhost port 9000 inter 5s
fastinter 1s downinter 120s

Would that do a "GET 1" when it tries a http health check for server A
and do a "GET 2" when doing a health check for server B?  These are
LDAP servers on the back-end, btw.

I can't put the health-check script on the back-end server itself.
And they wanted to make sure the health-check passed from the actual
haproxy load-balancer talking to the back-end server, rather than the
back-end server talking to itself.

Thank you,
PH

Reply via email to