Rebalancing Nodes

Nodes are rebalanced with the POST /controller/rebalance HTTP method and URI.

Description

To start a rebalance process, provide the ejectedNodes and knownNodes parameters.
These parameters contain the list of nodes that have been marked to be ejected and the list of nodes that are known within the cluster.

Retrieve information about ejected and known nodes by getting the current node configuration.
This ensures that the client making the REST API request is aware of the current cluster configuration.
Nodes should have been previously added or marked for removal as appropriate.

HTTP method and URI

The information must be supplied via the ejectedNodes and knownNodes parameters as a POST operation to the /controller/rebalance endpoint.

Response codes

If the wrong node information has been submitted, JSON with the mismatch error is returned:

{"mismatch":1}

Getting rebalance progress

HTTP method and URI

There are two endpoints for rebalance progress.
One is a general request which outputs high-level percentage completion at /pools/default/rebalanceProgress.
The second possible endpoint is one corresponds to the detailed rebalance report available in the web console.

This response shows percentage complete for each individual node undergoing rebalance.
For each specific node, it provides the current number of docs transferred and other items.
For details and definitions of these items.

Adjusting rebalance during compaction

Description

If a rebalance is performed while a node is undergoing index compaction, rebalance delays may be experienced.
The parameter, rebalanceMovesBeforeCompaction, is used to improve rebalance performance.
If this selection is made, index compaction performance is reduced which can result in larger index file size.

This needs to be made as POST request to the /internalSettings endpoint.
By default, this setting is 64 which specifies the number of vBuckets which are moved per node until all vBucket movements pauses.
After this pause, the system triggers index compaction.
Index compaction is not performed while vBuckets are being moved, so if a larger value is specified, it means that the server spends less time compacting the index, which results in larger index files that take up more disk space.