Rebalancing clusters

Rebalancing clusters

Clusters are rebalanced whenever a node is added or removed from a cluster.

Description

The available couchbase-cli rebalance commands are:

Command Description
rebalance Starts a cluster rebalancing.
rebalance-stop Stops the current cluster rebalancing.
rebalance-status Shows the status of the current cluster rebalancing.
>

CLI command and parameters

The couchbase-cli rebalance command options have all of the server-add command options and some additional options.

Parameter Description
--server-add=[host]:[port] Server to be added
--server-add-username=[username] Administrator username for the server to be added.
--server-add-password=[password] Administrator password for the server to be added.
--server-remove=[host]:[port] The server to be removed.
--recovery-buckets=BUCKETS Comma separated list of bucket name. Default is for all buckets.

Syntax

Syntax:


      
    

Example: Removing nodes and rebalancing

The following example removes a node from a cluster and rebalances:

couchbase-cli rebalance -c 192.168.0.1:8091
    --server-remove=192.168.0.2:8091

Example: Adding nodes and rebalancing

The following example adds a node to a cluster and rebalances:

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

Example: Removing nodes, adding nodes, and rebalancing

The following example removes and adds nodes from/to a cluster and rebalances:

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

Example: Stopping rebalance

The following example stops the current rebalancing:

couchbase-cli rebalance-stop -c 192.168.0.1:8091