The health-check command sets service health check parameters.
The undo health-check command deletes service health check parameter settings.
health-check type { dns | radius | tcp } [ tx-interval interval-value | times times-value | port port-number ] *
health-check type { http | https } [ req-url req-url-value | ept-code ept-code-value | tx-interval interval-value | times times-value | port port-number ] *
health-check type icmp [ tx-interval interval-value | times times-value ] *
undo health-check
| Parameter | Description | Value |
|---|---|---|
| dns | Sends DNS probe packets. |
- |
| http | Sends HTTP probe packets. |
- |
| https | Sends HTTPS probe packets. |
The virtual system does not support HTTPS health check. |
| req-url req-url-value | Specifies the URL of an HTTP health check request. |
The value is a string of 1 to 255 characters. |
| ept-code ept-code-value | Specifies the expected response code for the HTTP health check. |
The value is an integer ranging from 100 to 599. The default value is 200. |
| icmp | Sends ICMP probe packets. |
- |
| radius | Sends RADIUS probe packets. |
- |
| tcp | Sends TCP probe packets. |
- |
| tx-interval interval-value | Specifies the interval between sending probe packets. |
The value is an integer ranging from 3 to 10, in seconds. The default value is 5 seconds. |
| times times-value | Specifies the maximum number of consecutive probe failures. |
The value is an integer ranging from 2 to 10. The default value is 3. |
| port port-number | Specifies the destination port of a probe packet. |
The value is an integer ranging from 1 to 65535. |
This command sets service health check parameters. The rserver rip command specifies the real server to which the FW sends probe packets.
If the protocol type of probe packets is not ICMP, you must run the rserver rip or rserver command to configure a port for the real server before running the health-check command. Otherwise, the service health check result is inaccurate. If the probe protocol is TCP, configure a port for the real server based on the port number used to provide services. If the probe protocol is HTTP, HTTPS, DNS, or RADIUS (port number 1812), configure the port of the real server to a well-known port number.
The FW sends probe packets to a real server at a fixed interval (interval-value). When the number of consecutive check results indicating that the real server is faulty reaches the value of times-value, the FW sets the status of the real server to unavailable, stops distributing traffic to it, and keeps sending probe packets to it.
The source IP address of the probe packets does not require manual configuration, because the FW automatically uses the IP address of the outbound interface for packet detection as that of the detection source.
# Real server group grp1 has two real servers and provides HTTP services. Set the protocol type of probe packers to HTTP, the interval for sending probe packets to 4s, and the number of probe failures to 2.
<sysname> system-view [sysname] slb [sysname-slb] group 1 grp1 [sysname-slb-group-1] rserver rip 10.10.10.1 port 80 [sysname-slb-group-1] rserver rip 10.10.10.2 port 80 [sysname-slb-group-1] health-check type http tx-interval 4 times 2