vinfra service compute load-balancer pool set
Modify a load balancer pool:
usage: vinfra service compute load-balancer pool set [--name <name> --protocol {HTTP,HTTPS,TCP,UDP}] [--port <port> --algorithm <algorithm>] [--backend-protocol {HTTP,HTTPS,TCP,UDP}] [--backend-port <backend-port>] [--certificate-file <cert-file>] [--connection-limit <limit>] [--description <description>] [--healthmonitor type=<type>, url_path=<url>[,key=value,…]] [--member address=<ip> [,enabled=<bool>,weight=<int>]] [--privatekey-file <key>] [--enable-sticky-session | --disable-sticky-session] [--enable | --disable] <pool>
--name <name>
- Pool name
--protocol {HTTP,HTTPS,TCP,UDP}
- The protocol for incoming connections
--port <port>
- The port for incoming connections
--algorithm <algorithm>
- Load balancing algorithm (
LEAST_CONNECTIONS
,ROUND_ROBIN
, orSOURCE_IP
) --backend-protocol {HTTP,HTTPS,TCP,UDP}
- The protocol for destination connections
--backend-port <backend-port>
- The port for destination connections
--certificate-file <cert-file>
- An x.509 certificate file in the PEM format. Required for TLS-terminated HTTPS->HTTP load balancers.
--connection-limit <limit>
- The maximum number of connections permitted for this pool. The default value is -1 (infinite connections).
--description <description>
- Pool description
--healthmonitor type=<type>,url_path=<url>[,key=value,…]
-
Health monitor parameters:
type
: the health monitor type (HTTP
,HTTPS
,PING
,TCP
, orUDP
)url_path
: the URL path to the health monitor- comma-separated
key=value
pairs with keys (optional):delay
: the time, in seconds, between sending probes to members.enabled
: declares whether the health monitor is enabled or not (true
orfalse
).max_retries
: the number of successful checks required to change member status to ‘HEALTHY’. Ranges from 1 to 10.max_retries_down
: the number of unsuccessful checks required to change member status to ‘UNHEALTHY’. Ranges from 1 to 10.timeout
: the maximum time, in seconds, that a monitor waits to connect before it times out. This value must be less than thedelay
value.
--member address=<ip>[,enabled=<bool>,weight=<int>]
-
Member parameters:
address=<ip>
: an IPv4 address of the virtual machineenabled=<bool>
: declares whether the member is enabled or not. Can be ‘true’ or ‘false’.weight=<int>
: determines the share of connections that the member services compared to the other pool members. For example, a weight of 10 means that the member handles five times as many connections than a member with a weight of 2. A weight of 0 means that the member does not receive new connections but continues to service existing ones. Ranges from 0 to 256. The default value is 1. This option can be used multiple times.
--privatekey-file <key>
- A private TLS key file in the PEM format. Required for TLS-terminated HTTPS->HTTP load balancers.
--enable-sticky-session
- Enable session persistence.
--disable-sticky-session
- Disable session persistence.
--enable
- Enable the pool.
--disable
- Disable the pool.
<pool>
- Load balancer pool ID or name
Example:
# vinfra service compute load-balancer pool set mypool --algorithm ROUND_ROBIN \ --member address=192.168.31.153 --member address=192.168.31.22 \ --member address=192.168.31.51 --disable-sticky-session Operation accepted.
This command changes the parameters for the balancing pool mypool
as follows:
- sets the balancing algorithm to
ROUND_ROBIN
- adds the third member to the pool
- disables sticky session