A newer version of this documentation is available.

View Latest

Add nodes via CLI

Use CLI to add one or more nodes to an existing cluster.

The new nodes must have Couchbase Server installed, and Couchbase Server must be running on each node.

To add a node:

> couchbase-cli server-add \
      --cluster=localhost:8091  --user cluster-username --password cluster-password \
      --server-add=192.168.0.72:8091  --server-add-username=node-username \
      --server-add-password=node-password \
     --services=data,index,query

where:

Table 1. CLI parameters for adding a node
Parameter Description

--cluster

The IP address of a node in the existing cluster.

--user

The username for the existing cluster.

--password

The password for the existing cluster.

--server-add

The IP address of the node to be added to the cluster.

--server-add-username

The username of the node to be added.

--server-add-password

The password of the node to be added.

If adding was successful, you will see the following response: SUCCESS: server-add 192.168.0.72:8091

If you receive a failure message, you will be notified of the type of failure. You can add multiple nodes in one command by supplying multiple --server-add command-line options to the command.

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

Here’s an example of cluster rebalance after adding a new node:

Request syntax with rebalancing:

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

You can cancel the addition of a node to a cluster without having to perform a rebalance operation. Canceling the operation removes the server from the cluster without having transferred or exchanged any data, since no rebalance operation took place. You can cancel the operation using the Couchbase Web Console.