Hi,
I'm seeing bad haproxy behavior... and I know there is a chance I'm
using haproxy's health checking mechanism incorrectly.
When a single node is turned off (e.g. apache is stopped or the server
crashed) haproxy seems to think all the nodes are offline.
I can stop apache in a node and watch the haproxy?stats url indicate
various nodes are failing the healthcheck multiple times...
and are marked offline.
Any suggestions? Below is essentially my haproxy config with ip addr
and dns changed.
As you can see, my healthcheck url calls healthcheck.php so that we
can test various things like db connectivity of the server...
This php script return a 200 when everything is working and it is but
haproxy thinks everything is not working
when this test fails on a single node.
Anyway this is the worst possible bug for high availability. A single
node brings down the whole pool!
Am I doing something obviously wrong here?
Perhaps I should use a GET instead of a HEAD in the check...?
global
daemon
user haproxy
group haproxy
pidfile /root/haproxy.pid
log 192.168.2.200 local3
defaults
retries 3
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 300000
option httplog
option logasap
log 192.168.2.200 local3
listen example.com x.x.x.x:80
mode http
balance roundrobin
option httplog
option logasap
log 127.0.0.1 local0
stats enable
stats auth admin:xxxxxxx
option forwardfor
option httpchk HEAD http://example.com/healthcheck.php
HTTP/1.0\r\nHost:\ example.com
option clitcpka
server fu1.example.com 10.x.x.x:80 check inter 30000 rise 1 fall 2
server fu2.example.com 10.x.x.x:80 check inter 30000 rise 1 fall 2
server fu3.example.com 10.x.x.x:80 check inter 30000 rise 1 fall 2
--
David Stainton