cluster backend add
Man Page | doveadm-cluster-backend(1) |
---|
Adds a new backend to cluster.
Appearance
Use doveadm cluster site add
to create a site.
New sites start in online
status. Provide a site name (required), and optionally a tag and load-balancer host used for inter-site proxying.
The UUID/ID should only be supplied when re-adding a previously removed site (otherwise, it is autogenerated by default).
cluster_local_site
used by your Proxies/Backends and the controller’s CLUSTER_SITE
. Mismatches will break routing for that site.doveadm cluster site add --load-balancer lb.dc1.example.com DC1
(tag optional)Important
Palomar requires a front LB for proxy ingress; it must be transparent or speak HAProxy PROXY v2.
You can update status, load balancer, and (if necessary) name.
WARNING
If you rename, it must continue to match cluster_local_site
on all servers in that site or the site stops operating.
doveadm cluster site update --status {online|offline|standby|evacuate} [--load-balancer HOST] NAME
(or --self
). Changing status also clears any active force-move.When Backend Load Balancing is enabled, the controller automatically rebalances load using a Z-score-based index. It evaluates backend load once per minute and moves users in batches; each user stays on a backend for at least one hour to avoid thrashing.
Automatic balancing waits until enough Prometheus samples have been collected before beginning to move users.
For emergency or planned rebalances between sites, you can use site force-move to drain a percentage of users from one site to one or more destination sites (hash-based selection). Start/update/stop are supported, and the state is tracked in GeoDB.
Feature states can be toggled per-site via the controller UI or API.
States: on
, dryrun
, off
.
Settings are persisted in GeoDB ([settings,cluster_settings]]).
By default features are disabled; if the table doesn’t exist, all features are treated as enabled for backward compatibility.
UI changes affect only the local site.
If enabled, the controller automatically offlines broken hosts and/or moves users away based on failure ratios and cooldowns (e.g., HOST_FAILURE_RATIO
, HOST_FAILURE_MIN_LOGINS
, HOST_FAILURE_COOL_TIME_SECS
).
If disabled, the controller will not take backends offline or move users due to health issues.
If enabled, the controller moves users to even load using Z-scores and thresholds like HOST_LOAD_BALANCE_SCORE_DELTA_THRESHOLD_RATIO
, HOST_LOAD_BALANCE_MIN_SAMPLES
, and HOST_LOAD_BALANCE_MIN_COOL_TIME_SECS
.
If disabled, no automatic moves occur.
If enabled, the controller exports Prometheus metrics; if disabled, the /metrics
endpoint won’t serve data.
Proxies within the same site have identical configuration. Adding a new proxy can be done by just launching a new proxy server and adding it into the load balancer's proxy pool.
Dovecot doesn't explicitly keep track of the proxies. However, they usually show up in the proxy_dest_stats
table in GeoDB. It may be useful to manually remove those rows eventually.
Remove the proxy server from the load balancer's proxy pool. Wait for a while so at least some of the connections finish on their own. Shutdown the server to forcibly disconnect the rest of the connections.
doveadm cluster backend add
adds a new Backend.
On the Backend host, --self
usually suffices; cluster_local_site
and cluster_backend_name
are taken from config and the backend is added as standby.
Use UUID only when re-adding. (Backend ID is auto-generated otherwise.)
Additionally, the backend must be added by a resolvable hostname (not raw IP).
Ensure all Proxies/Backends share the same doveadm TCP settings (doveadm_port
, doveadm_password
) and that monitoring users (e.g., probe-%{backend_host}
) are configured on both Proxy and Backend as documented.
doveadm cluster backend update
--status
changes a backend status between offline/standby/online.
offline
backend is online again, it changes the status automatically to online
.standby
backends are not automatically touched.offline
nor standby
backends receive any new connections. Existing connections are not kicked/moved, so normally backends shouldn't be set standby
before the users are moved out.doveadm cluster backend update
--load-factor
changes load-factor for a backend.
This can be used to (temporarily) reduce load from backend. Normally, load should always be set to 100
. This is primarily used by the controller.
This setting is not accurate, so setting it to 99
or 78
will not have the expected effect.
Recommended values are 100
, 50
, and 0
for draining the host.
You can evacuate a backend by setting its load-factor to 0
with doveadm cluster backend update
--load-factor 0
. Controller will notice this and start moving users to other backends. There is also the evacuate button to trigger immediate move of all users to other backends.
If you need a backend evacuation without controller, you can use doveadm cluster user batch move backend
--count 1000000
to immediately move all users to other backend(s).
WARNING
This command exits without waiting for the moves to complete.
WARNING
Immediate evacuation methods can potentially increase the load on the source backend significantly if many backends are pulling metacache from it at the same time.
After evacuation is complete, shutdown Dovecot to make sure all sessions are gone.
Finally, set the status of the backend to standby
to signify that the backend is not usable for connections.
doveadm who
)doveadm cluster backend remove
)Controller attempts to prevent backend from becoming overloaded by automatically moving users out, but this may not always happen fast enough. To make it happen faster, you can change backend load-factor to a smaller number or even to 0 to remove all users from the backend.
Outside Kubernetes (e.g., Docker Compose), use site features to disable automation:
off
(or dryrun
) via the UI/API.doveadm cluster user status
shows the current status for a user.
doveadm cluster user access
accesses a backend as a given user and prints which backend it was.
This command can also cause a connection to the other site. This command is mainly used internally, but may be helpful also for debugging.
doveadm cluster user move backend
moves the given user to the given backend.
doveadm cluster user batch move backend
moves a number of users to the given backends.
WARNING
This command exits without waiting for the move to complete.
doveadm cluster user move site
moves the given user to the given site.
WARNING
This command exits without waiting for the move to complete.
Controller supports autoscaling. There are two autoscalers to choose from:
This is the default scaler, and returns number of backends in site.
This scaler calls method get_desired_number_of_backends(site)
and expects it to return number of desired backends.
Controller offers feature control via the admin UI or HTTP API. The features that can be switched 'on', 'dryrun' or 'off' are:
/metrics
HTTP endpoint.Feature settings are recorded in a table (cluster_settings
) in GeoDB and are disabled by default. If the table is not present, all features are enabled for backward-compatibility.
To manage feature settings via the admin page, navigate to Site features
page from the left pane. Note that you can only change feature settings of the local site via controller admin UI. To manage the features via the controller API, see OpenAPI documentation.
HOST_LOAD_BALANCE_MIN_SAMPLES
are collected to avoid premature balancing decisions.redis-wait
), which aid startup/operational visibility.# create site with cross-site LB and shard tag
doveadm cluster site add --load-balancer lb.dc1.example.com --tag dc1-shard-a DC1
# start moving a controlled percentage of users away from DC1 into DC2/DC3
doveadm cluster site force-move start DC1 25 DC2 DC3
# later, increase percentage (e.g., 60%)
doveadm cluster site force-move update DC1 60
# stop when done
doveadm cluster site force-move stop DC1
# run on the backend host after configuring cluster_local_site and cluster_backend_name
doveadm cluster backend add --self
cluster backend add
Man Page | doveadm-cluster-backend(1) |
---|
Adds a new backend to cluster.
cluster backend force-move start
Man Page | doveadm-cluster-backend(1) |
---|
Forcibly start moving users out of the backend while they are logging in.
cluster backend force-move stop
Man Page | doveadm-cluster-backend(1) |
---|
Stop an already started force-move.
cluster backend force-move update
Man Page | doveadm-cluster-backend(1) |
---|
Update a new percentage to an already started force-move.
cluster backend list
Man Page | doveadm-cluster-backend(1) |
---|
Lists all backends in this cluster, including other sites.
cluster backend remove
Man Page | doveadm-cluster-backend(1) |
---|
Remove a backend from cluster.
cluster backend status
Man Page | doveadm-cluster-backend(1) |
---|
Shows the current status of the backend.
cluster backend update
Man Page | doveadm-cluster-backend(1) |
---|
Update a cluster backend's status.
cluster geodb refresh
Man Page | doveadm-cluster-geodb(1) |
---|
Refreshes local caches from GeoDB
cluster kick
Man Page | doveadm-cluster-kick(1) |
---|
Disconnect user’s connections from the cluster.
cluster site add
Man Page | doveadm-cluster-site(1) |
---|
Adds a new site to cluster.
cluster site force-move start
Man Page | doveadm-cluster-site(1) |
---|
Forcibly start moving users out of the site while they are logging in.
cluster site force-move stop
Man Page | doveadm-cluster-site(1) |
---|
Stop an already started force-move.
cluster site force-move update
Man Page | doveadm-cluster-site(1) |
---|
Update a new percentage to an already started force-move.
cluster site list
Man Page | doveadm-cluster-site(1) |
---|
List all sites.
cluster site remove
Man Page | doveadm-cluster-site(1) |
---|
Remove a site.
cluster site status
Man Page | doveadm-cluster-site(1) |
---|
Site status.
cluster site update
Man Page | doveadm-cluster-site(1) |
---|
Update site status and load balancer.
cluster tag create
Man Page | doveadm-cluster-tag(1) |
---|
Creates a new tag for cluster.
cluster tag delete
Man Page | doveadm-cluster-tag(1) |
---|
Delete a tag.
cluster tag list
Man Page | doveadm-cluster-tag(1) |
---|
List all tags.
cluster tag update
Man Page | doveadm-cluster-tag(1) |
---|
Change tag name.
cluster user access
Man Page | doveadm-cluster-user(1) |
---|
Perform cluster lookup for the user (or users).
cluster user batch move backend
Man Page | doveadm-cluster-user(1) |
---|
Initiates moving a number of users to different backends.
cluster user batch move site
Man Page | doveadm-cluster-user(1) |
---|
Initiates moving a number of users to different sites.
cluster user batch move status
Man Page | doveadm-cluster-user(1) |
---|
Output the status of the currently running user batch move.
cluster user batch move stop
Man Page | doveadm-cluster-user(1) |
---|
Stop the currently running user batch move.
cluster user delete
Man Page | doveadm-cluster-user(1) |
---|
Deletes a record from GeoDB.
cluster user move backend
Man Page | doveadm-cluster-user(1) |
---|
Initiates moving user to a different backend.
cluster user move site
Man Page | doveadm-cluster-user(1) |
---|
Initiates moving user to a different site.
cluster user move status
Man Page | doveadm-cluster-user(1) |
---|
Output the status of the current user move queue.
cluster user status
Man Page | doveadm-cluster-user(1) |
---|
Displays status information of a user.