Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
7.2 Using couchbase-cli
Chapter Sections
Chapters

7.2.5. Rebalancing a Cluster

To remove a node from a cluster and then rebalance the entire cluster, use the rebalance command with the --server-remove=HOST[:PORT] option. In the option specify the host and port for the node you want to remove:

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

To remove and add nodes to/from a cluster and then rebalance, use the rebalance command with the --server-remove=HOST[:PORT] and --server-add=HOST[:PORT] options:

shell> couchbase-cli rebalance -c 192.168.0.1:8091 \
      --server-remove=192.168.0.2 \
      --server-add=192.168.0.4

Couchbase Server will remove one node, add another node, and then perform a cluster rebalance. During the rebalance, you will see status updates from the server:

. METHOD: GET
PARAMS:  {}
ENCODED_PARAMS:
REST CMD: GET /pools/default/rebalanceProgress
response.status: 200

To view the status of a cluster rebalance, use the rebalance-status command:

shell> couchbase-cli rebalance-status -c 10.4.2.6 -u Administrator -p password

If the rebalance is in progress without any errors, Couchbase Server will return:

(u'running', None)

To stop a current cluster rebalance, use the rebalance-stop command:

shell> couchbase-cli rebalance-stop -c 192.168.0.1:8091

When Couchbase server stops the rebalance, it will return:

SUCCESS: rebalance cluster stopped