A newer version of this documentation is available.

View Latest

rebalance

Starts cluster rebalancing.

Syntax

The basic syntax is:

couchbase-cli rebalance -c [host]:8091 -u [admin] -p [password] [options]

Description

This command triggers a cluster rebalance operation which redistributes all vbuckets evenly between all nodes currently in the cluster. Typically you would want to rebalance when adding new nodes to a cluster or removing existing nodes.

Nodes can only be removed from a cluster as part of the rebalance command, using the --server-remove parameter. Usually nodes are added to a cluster and initialized using the server-add command before rebalancing .

Adding a server directly as part of the rebalance command using the --server-add parameter is deprecated and this functionality will be removed in a future release.

You can then cancel an ongoing rebalance using the Couchbase Web Console or using the rebalance-stop command.

Options

The following are the command options:

Table 1. rebalance options
Parameter Description

--server-add=[host]:[port]

Server to be added.

Adding a server directly as part of the rebalance command using the --server-add parameter is deprecated and this functionality will be removed in a future release.

--server-add-username=[username]

Administrator username to add the server.

--server-add-password=[password]

Administrator password to add the server.

--server-remove=[host]:[port]

The server to be removed.

--index-storage-setting=SETTING

Index storage type [default, memopt].

--services=data,index,query

Services that the server runs.

Examples

Removes a node from a cluster and rebalances:

couchbase-cli rebalance -c 192.168.0.1:8091 -u Administrator -p password \
--server-remove=192.168.0.2:8091