add server
Add a dynamic server to a backend.
Description
Instantiate a new server attached to an existing backend. Such a server may also be called a dynamic server.
The specified server name must not already be in use in the backend. The backend must be configured to use a dynamic load-balancing algorithm for the balance
directive: roundrobin
, leastconn
, first
, or random
.
A dynamic server is not restored after a proxy reload operation. If you need the server definition to persist, add it to the HAProxy Enterprise configuration file.
Dynamic servers are statically initialized with the none init-addr
method. In this method, the server starts in the down state without a valid IP address.
It may be possible to reach the fd
(file descriptor) limit when using a large number of dynamic servers. See also fd-hard-limit
and ulimit-n
in the global keyword documentation.
The following keywords are supported for configuring the new server:
Keyword | Note |
---|---|
agent-addr | |
agent-check | Even when enabled by this keyword, agent check is still inactive until activated independently of the server with the |
agent-inter | |
agent-port | |
agent-send | |
allow-0rtt | |
alpn | |
addr | |
backup | |
ca-file | |
check | Even when enabled by this keyword, health check is still inactive until activated independently of the server with the |
check-alpn | |
check-proto | |
check-send-proxy | |
check-sni | |
check-ssl | |
check-via-socks4 | |
ciphers | |
ciphersuites | |
crl-file | |
crt | |
disabled | |
downinter | |
enabled | |
error-limit | |
fall | |
fastinter | |
force-sslv3/tlsv10/tlsv11/tlsv12/tlsv13 | |
id | |
inter | |
maxconn | |
maxqueue | |
minconn | |
no-ssl-reuse | |
no-sslv3/tlsv10/tlsv11/tlsv12/tlsv13 | |
no-tls-tickets | |
npn | |
observe | |
on-error | |
on-marked-down | |
on-marked-up | |
pool-low-conn | |
pool-max-conn | |
pool-purge-delay | |
port | |
proto | |
proxy-v2-options | |
rise | |
send-proxy | |
send-proxy-v2 | |
send-proxy-v2-ssl | |
send-proxy-v2-ssl-cn | |
slowstart | |
sni | |
source | |
ssl | |
ssl-max-ver | |
ssl-min-ver | |
tfo | |
tls-tickets | |
track | A dynamic server may use this keyword to follow the check status of another server from the configuration. However, it is not possible to track another dynamic server. This restriction ensures that the tracking chain is kept consistent in the event a dynamic server is deleted. |
usesrc | |
verify | |
verifyhost | |
weight | |
ws |
For syntax details, see Server configuration.
Servers added with this command can be deleted using the del server
command.
Examples
Below, we add the server server2 to backend be_test:
$ echo "add server be_test/server2 enabled maxconn=1000" | \
sudo socat stdio unix-connect:/var/run/hapee-2.5/hapee-lb.sock
See also
Next up
add ssl crt-list