Layer 4 (LVS)
Health checks
The LB Layer4 tab supports the following types of server health checks.
ARP health checks Jump to heading
When load balancing UDP-based services, you can health check your servers by using the Address Resolution Protocol (ARP) to check whether a server with a given IP address exists on the network.
When you set up ARP health checks, HAProxy ALOHA regularly broadcasts an ARP request to all devices on the network to verify that a server with a given IP address exists. If a matching server does not reply, the health check fails.
-
Select the LB Layer4 tab.
-
Update your configuration in the following ways:
- Add a
check
argument to eachserver
line for which you would like to enable health checking. - Add
option arpcheck
in the same section. - Add the
check
directive to the section to configure other options.
haproxydirector syslog_servers 10.0.0.9:514 UDPbalance roundrobin # load balancing algorithmmode gateway # forwarding modeoption arpcheckcheck interval 5s timeout 1s # advanced check parametersserver syslog1 10.0.0.1:514 checkserver syslog2 10.0.0.2:514 checkhaproxydirector syslog_servers 10.0.0.9:514 UDPbalance roundrobin # load balancing algorithmmode gateway # forwarding modeoption arpcheckcheck interval 5s timeout 1s # advanced check parametersserver syslog1 10.0.0.1:514 checkserver syslog2 10.0.0.2:514 checkThe
option arpcheck
directive uses the following syntax:textoption arpcheck [iface <name>]textoption arpcheck [iface <name>]Argument Description iface <name>
(optional)Network interface to use when sending the ARP request. The
check
directive uses the following syntax:textcheck { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>][rise <count>] [fall <count>] [inhibit] }textcheck { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>][rise <count>] [fall <count>] [inhibit] }Option Description 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. - Add a
-
To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.
ICMP health checks Jump to heading
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.
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.
-
Select the LB Layer4 tab.
-
Update your configuration in the following ways:
- Add a
check
argument 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
check
directive to the section to configure other options.
haproxydirector syslog_servers 10.0.0.9:514 UDPbalance roundrobin # load balancing algorithmmode gateway # forwarding modeoption icmpcheckcheck interval 5s timeout 1s # advanced check parametersserver syslog1 10.0.0.1:514 checkserver syslog2 10.0.0.2:514 checkhaproxydirector syslog_servers 10.0.0.9:514 UDPbalance roundrobin # load balancing algorithmmode gateway # forwarding modeoption icmpcheckcheck interval 5s timeout 1s # advanced check parametersserver syslog1 10.0.0.1:514 checkserver syslog2 10.0.0.2:514 checkThe
check
directive uses the following syntax:textcheck { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>][rise <count>] [fall <count>] [inhibit] }textcheck { [timeout <seconds>] [interval <seconds>] [source <ip>] [port <port>][rise <count>] [fall <count>] [inhibit] }Option Description 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. - Add a
-
To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.
Do you have any suggestions on how we can improve the content of this page?