We have started doing some testing with the external health check
functionality but unfortunately we cannot get the real servers to be
marked as online when using this feature.

This was tested with haproxy-ss-20140720

When using the external check the real servers are never marked as up.
The external script being called just exits with a status of 0, we are
getting this in the log -
Aug  4 09:00:19 lbmaster haproxy[31688]: Health check for server
VIP_Name/RIP_Name-1 failed, reason: External check passed, code: 0,
check duration: 6002ms, status: 0/2 DOWN.

It looks like the check is passing but its not bringing the service online.

If we set the script to exit with a status of 1 the log shows -
Aug  4 09:39:48 lbmaster haproxy[31917]: Health check for server
VIP_Name/RIP_Name failed, reason: External check error, code: 1, check
duration: 6001ms, status: 0/2 DOWN.

 The configuration is as follows -

global
daemon
stats socket /var/run/haproxy.stat mode 600 level admin
pidfile /var/run/haproxy.pid
log /dev/log local4
maxconn 40000
ulimit-n 81000
tune.bufsize 16384
tune.maxrewrite 1024
external-check

defaults
mode http
balance roundrobin
timeout connect 4000
timeout client 42000
timeout server 43000
log global

listen VIP_Name
bind 192.168.66.198:81 transparent
mode tcp
balance leastconn
server backup 127.0.0.1:9081 backup  non-stick
option redispatch
option abortonclose
maxconn 40000
log global
option tcplog
option log-health-checks
option external-check
external-check command /root/check.sh
server RIP_Name 192.168.66.50:80  weight 1  check  inter 6000  rise 2
fall 3  minconn 0  maxconn 0  on-marked-down shutdown-sessions
server RIP_Name-1 192.168.66.51:80  weight 100  check  inter 6000
rise 2  fall 3  minconn 0  maxconn 0  on-marked-down shutdown-sessions

The /root/check.sh

#!/bin/bash

exit 0

Thanks

Mark

Reply via email to