rebalance

rebalance

Starts cluster rebalancing.

Syntax

The basic syntax is:

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

Description

The typical command used to add a node to a cluster is the server-add command. However, a node can also be added to a cluster when executing the rebalance command.

Note: Once a server has been successfully added, the Couchbase Server cluster indicates that a rebalance is required to complete the operation.

You can cancel the addition of a node to a cluster without rebalancing. Canceling the operation removes the server from the cluster without transferring or exchanging any data since no rebalance operation took place. You can cancel rebalancing using the Couchbase Web Console.

Options

The following are the command options:

Table 1. rebalance options
Parameter Description
--server-add=[host]:[port] Server to be added
--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

Adds a node to a cluster and rebalances:

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

Removes and adds nodes from/to a cluster and rebalances:

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