Create a task force
Control panel
OpenStack CLI
-
В control panels go to Cloud platform → Balancers.
-
Open the tab Target groups
-
Click Create a task force.
-
Select region and pool where it will be created target group. The balancer and the target must be in the same pool.
-
Select a load balancer.
-
Select the traffic destination protocol that the balancer uses to send traffic to the target group. The following combinations of protocols are available for receiving traffic on the balancer and forwarding traffic to the destination group:
- TCP-TCP is classic L4 balancing;
- TCP-PROXY — client information is not lost and is transmitted in a separate connection header;
- UDP-UDP — The UDP protocol is faster than TCP, but less reliable;
- HTTP-HTTP — L7-balancing;
- HTTPS-HTTP — L7 balancing with encryption and SSL certificate termination on the balancer.
-
A default port will be automatically selected for the selected protocol — change it if necessary. The port value will be common to all servers in the group.
-
Open the tab Servers.
-
Mark the servers to be added to the target group.
-
Specify settings for each marked server:
10.1 Select the IP address.
10.2 Optional: change the port.
10.3 Specify the server weight — this is a proportional measure, denotes the share of requests that the server handles. If the weights are the same, the servers serve the same number of requests. If, for example, there is one server in a group with a weight of "2" and two servers with a weight of "1", the first server will receive 50% of all requests and the other two will each receive 25%. The maximum weight value is 256.
10.4 Optionally: to direct traffic to a server only when other servers in the group are unavailable, check the checkbox Reserve.
-
Open the tab Algorithm.
-
Select query distribution algorithm — Round Robin or Least connections.
-
Optional: to enable the method Sticky Sessions and check the box Sticky sessions.
-
Open the tab Accessibility checks.
-
Select type accessibility checks. Once a group is created, the type of check cannot be changed.
-
If you selected the HTTP validation type, specify the request parameters — method, path, and expected response codes.
-
Specify the check interval — the interval in seconds at which the balancer sends check requests to servers.
-
Specify the connection timeout — the time to wait for a response in seconds, must be less than the interval between checks.
-
Specify the success threshold — the number of successful accesses in a row, after which the server is put into a working state.
-
Specify the failure threshold — the number of unsuccessful requests in a row, after which the server is suspended.
-
Optional: change the name of the target group or leave the default name generated.
-
Optional: enter a comment on the group.
-
Click Create a task force.
-
Create a task force:
openstack loadbalancer pool create \
--name <pool_name> \
--lb-algorithm <algorithm> \
--listener <listener_name> \
--protocol <protocol_name>Specify:
<pool_name>
— the name of the target group;<algorithm>
— algorithm name:ROUND_ROBIN
orLEAST_CONNECTIONS
<listener_name>
— rule name, can be viewed withopenstack loadbalancer listener list
<protocol_name>
— protocol name.
-
Add the server to the target group:
openstack loadbalancer member create \
--subnet-id <subnet_uuid> \
--address <server_ip_address> \
--protocol-port <port> \
<pool_name>Specify:
<subnet_uuid>
— The ID of the server's private or public subnet. The list can be viewed byopenstack subnet list
;<server_ip_address>
— The IP address of the server from the specified subnet;<port>
— port number;<pool_name>
— the name of the target group you created in step 2.
-
Optional: create accessibility check:
openstack loadbalancer healthmonitor create \
--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_name>Specify:
-
<delay>
— the interval between checks in seconds; -
<timeout>
— the time to wait for a response in seconds; -
<max_retries>
— number of consecutive successful accesses, after which the server is brought back online; -
<max_retries_down>
— number of unsuccessful requests in a row, after which the server is suspended; -
<type>
— type of verification:HTTP
,PING
,TCP
,TLS_HELLO
,UDP_CONNECT
; -
HTTP request parameters, if you have selected the check type —
HTTP
:--http-method <http_method>
— method of verification:GET
,POST
,DELETE
,PUT
,HEAD
,OPTIONS
,PATCH
,CONNECT
,TRACE
;--url-path <url_path>
— query path without a domain name;--expected-codes <codes>
— expected response codes, separated by commas;
-
<pool_name>
— the name of the target group that you set in step 2.
-