HAProxy Enterprise Documentation 2.2r1

Enable/Disable Servers

Use the HAProxy Enterprise Real-time Dashboard or the Runtime API to change the state of your backend servers dynamically, including enabling and disabling them.

Change server state in the Real-time Dashboard

To manage the state of your servers using the Real-time Dashboard, follow these steps:

  1. Install the Real-time Dashboard.

  2. Connect the dashboard to your load balancer data by installing either the Dashboard Lua module or the Dashboard Gateway.

  3. Open the Real-time Dashboard and go to the Stats page.

  4. In the Backend webservers section, select the servers that you want to change the state of by clicking the checkbox in the Server column.

  5. Disable a server by clicking the Disable action button. Enable a disabled server by clicking the Enable action button. You can also select one of the other available actions in the select list at the bottom of the section.

    [Disable a server in the Real-time Dashboard]

There are a number of actions available in the select list:

State name

Description

Set state to READY

Set server state to READY (Enable Server)

Set state to DRAIN

Set server state to DRAIN (remove from load-balancing, but remain available for health checks and persistent connections)

Set state to MAINT

Set server state to MAINT (Disable Server)

Health: disable checks

Mark active server health checks as temporarily stopped

Health: enable checks

Enable active server health checks

Health: force UP

Force server health to UP (regardless of pending checks)

Health: force NOLB

Force server health to NOLB state (regardless of slow checks)

Health: force DOWN

Force server health to DOWN (regardless of pending checks)

Agent: disable checks

Mark auxiliary agent checks as temporarily stopped

Agent: enable checks

Enable auxiliary agent checks

Agent: force UP

Force server agent state to UP

Agent: force DOWN

Force server agent state to DOWN

Kill Sessions

Immediately terminate all server sessions

Change server state using the Runtime API

To manage the state of your servers using the Runtime API, follow these steps:

  1. Enable the Runtime API.

  2. Call the set server command to change a server's state.

    In the example below, we change the server's state to maint (maintenance mode):

    $ echo "set server webservers/s1 state maint" | sudo socat stdio unix-connect:/var/run/hapee-2.2/hapee-lb.sock

Next up

Dynamic Data Updates