Manage availability checks
A target group can have only one health check.
In a health check, you can edit all parameters except for the check type. If you need to change the check type, you can delete the existing health check and create a new one with the required type via the OpenStack CLI.
Create an availability check
OpenStack CLI
-
Create an availability check:
openstack loadbalancer healthmonitor create \--name <name> \--delay <delay> \--timeout <timeout> \--max-retries <max_retries> \--max-retries-down <max_retries_down> \--type <type> \--http-method <http_method> \--url-path <url_path> \--expected-codes <codes> \<pool>Specify:
-
<delay>— interval between checks in seconds; -
<timeout>— response timeout in seconds; -
<max_retries>— number of consecutive successful requests after which the server is set to operational status; -
<max_retries_down>— number of consecutive failed requests after which the server operation is suspended; -
<type>— check type depending on the target group protocol:- TCP group —
TCP,PING; - PROXY group —
TLS_HELLO,HTTP,TCP,PING; - UDP group —
UDP_CONNECT,PING; - HTTP group —
HTTP,TCP,PING;
- TCP group —
-
HTTP request parameters if you selected the
HTTPcheck type:--http-method <http_method>— check method:GET,POST,DELETE,PUT,HEAD,OPTIONS,PATCH,CONNECT,TRACE;--url-path <url_path>— request path without domain name;--expected-codes <codes>— comma-separated expected response codes;
-
<pool>— target group ID or name, can be viewed using the commandopenstack loadbalancer pool list.
-
Modify an availability check
Control panel
OpenStack CLI
-
In the Control panel, in the top menu, click Products and select Cloud Servers.
-
Go to Load Balancers → Target Groups tab.
-
Open the target group page.
-
Make sure that the Health checks toggle switch is enabled.
-
If the check type is HTTP, you can change the URL request and expected response codes. To do this, click Edit and enter the new settings.
-
Optional: open the Advanced rule settings section and specify connection settings:
- for incoming requests to the load balancer — specify the connection timeout and connection limit;
- for requests from the load balancer to the servers — specify the connection timeout, inactivity timeout, and TCP packet wait timeout.
-
Click Save.
Delete an availability check
If you delete an availability check, the load balancer will route traffic to all servers in the target group, including unavailable ones.
OpenStack CLI
-
Delete the check:
openstack loadbalancer healthmonitor delete <health_monitor>Specify
<health_monitor>— health check ID or name, can be viewed using the commandopenstack loadbalancer healthmonitor list.