Reference
del server
Available since
- HAProxy 2.4
- HAProxy Enterprise 2.4r1
Remove a dynamic server from a backend.
Description Jump to heading
Remove a dynamic server attached to a backend. This operation is valid only for dynamic servers, those added using the Runtime API add server
command. For versions 2.4r1 and 2.5r1, this operation is supported only on a CLI connection running in experimental mode (experimental-mode on
).
All servers are eligible, except servers which are referenced by other configuration elements. The server must be put in maintenance mode prior to its deletion. The operation is cancelled if the server still has active or idle connections or its connection queue is not empty.
Examples Jump to heading
Below, we delete the server server2
from backend be_test
.
First place the server in maintenance mode. As an alternative to the set server
command, you could use the disable server
command.
nix
echo "set server be_test/server2 state maint" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "set server be_test/server2 state maint" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
Delete the server.
nix
echo "del server be_test/server2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "del server be_test/server2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
For versions 2.4r1 and 2.5r1, experimental-mode
must be on
.
nix
echo "experimental-mode on; del server be_test/server2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "experimental-mode on; del server be_test/server2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
See also Jump to heading
Do you have any suggestions on how we can improve the content of this page?