Skip to content
SHC Docs

shc rebalance

plan or run the moves that even out load across nodes

Nothing moves back on its own after a failover or a node’s return; a rebalance is always an operator’s request. --plan prints the moves that would lower the load of the most constrained nodes, each with its explain, and changes nothing. --apply plans afresh on the daemon, never from a plan printed earlier, runs the moves in order through the ordinary move (the relocation a rule change makes) and stops at the first that fails. Each move is checked against the estate again just before it runs, so a move the estate has outrun is not made, and the node that runs it holds the deployment against every other move, drain and rebalance, on any node, until it finishes.

Load is the larger share of committed memory and cpu on a node, or its deployment count when a ready node’s capacity is not measured. A move is taken only when its node and its target both end below the node’s load before it. Among the targets that would, the move goes to the one placement’s scorer ranks first, as an install would, so the room each target’s pool keeps counts; each move names why its target was chosen and why the others were not. Stateless work moves before reattachable work; pinned, far and stopped deployments stay, each with its reason.

shc rebalance --plan | --apply [flags]
--apply plan afresh and run the moves
-h, --help help for rebalance
--plan print the moves and change nothing
-y, --yes skip the confirmation before --apply
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc - Selfhosted Cloud CLI