Adding nodes to clusters

Adding nodes to clusters

Nodes can be added to clusters with either the server-add or rebalance command.

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.

CLI command and parameters

The following parameters are applicable to both server-add and rebalance commands.

Parameter Description
--cluster [localhost]:8091 Cluster where the server is to be added to.
--server-add=[host]:8091 The server to be added.
--server-add-username=[administrator] Administrator name for the server to be added.
--server-add-password=[password] Administrator password for the server to be added.

Syntax

Request syntax with server-add :

couchbase-cli server-add 
    --cluster [localhost]:8091 
    --server-add=[host]:8091 
    --server-add-username=[administrator] 
    --server-add-password=[password]

Request syntax with rebalance :

couchbase-cli rebalance
    -c [localhost]:8091 
    --server-add=[host]:8091 
    --server-add-username=[administrator] 
    --server-add-password=[password]

Example

The following example adds a node to a cluster but does not rebalance:

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

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