Rolling restarts
Drain mode, added in 3.2.0, empties a node before you restart it.
/anchor drain lobby-2- The node stops receiving new players from the balancer.
- Players on it get a chat notice and are moved to other lobbies in the same region, a few per second.
- When the node is empty, or after
drain.timeout-seconds, remaining players are moved at once. /anchor statusshows the node asdrained. Restart it.- When it sends heartbeats again it rejoins the balancer on its own.
Scripting it
Section titled “Scripting it”The Velocity console accepts anchor drain <node> --wait, which returns only when the node is drained.
A simple restart loop:
for node in lobby-1 lobby-2 lobby-3; do rcon velocity "anchor drain $node --wait" ssh "$node" systemctl restart paper sleep 30doneGame servers
Section titled “Game servers”Draining a game node only stops new matches from starting there. Running matches finish normally,
up to drain.timeout-seconds.