ICMP
When load balancing UDP-based services via the LB Layer4 tab, you can health check your servers by pinging them with the Internet Control Message Protocol (ICMP) to see if they're up. An ICMP ping sends an echo request packet to the server and then waits for a reply.
Enable ICMP ping
When you set up ICMP health checks, HAProxy ALOHA regularly tries to send the server a ping request. If the server does not return a response, the health check fails.
Check the availability of two Syslog servers.
director syslog_servers 10.0.0.9:514 UDP
balance roundrobin # load balancing algorithm
mode gateway # forwarding mode
option icmpcheck
check interval 5s timeout 1s # advanced check parameters
server syslog1 10.0.0.1:514 check
server syslog2 10.0.0.2:514 check
Select the LB Layer4 tab.
Add a
check
parameter to eachserver
line for which you would like to enable health checking.Add
option icmpcheck
in the same section. It take no arguments.-
Add the line
check
to the section to configure other options. It uses the following syntax:check { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>] [rise <count>] [fall <count>] [inhibit] }
timeout <seconds>
Period after which an attempt without a response from the server is considered as failed (default: half of
interval
)interval <seconds>
Interval between two checks, in seconds (default: 10 seconds)
source <ip>
Source IP to use when performing the check
port <port>
Forces the destination port (default: real server port, if it exists)
rise <count>
A server will be considered as operational after <count> consecutive successful health checks. The default is 1.
fall <count
A server will be considered as dead after <count> consecutive unsuccessful health checks. The default is 1.
inhibit
If a server is down, its weight is passed to 0 but not deleted. Established connection are not broken but new connections are dispatched on the other servers.
Next up
TCP