server-add

server-add

Adds one or more servers to a cluster.

Syntax

The basic syntax is:

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

Description

Couchbase Server services are enabled when you add a node to a cluster and specify its services.

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. Cancel the operation using the Couchbase Web Console.

Attention: Couchbase Server services can only be enabled via the CLI when adding a server to an existing cluster.

Options

The following are the command options:

Table 1. server-add options
Parameter Description
--server-add=HOST [:PORT] The server that is added.
--server-add-username=USERNAME Administrator name to add the server.
--server-add-password=PASSWORD Administrator password to add the server.
--group-name=GROUPNAME The name of the group to which the server is added.
--index-storage-setting=SETTING Index storage type [default, memopt].
--services=data,index,query Services that run on the server. To specify multiple services, separate the service with a comma.

For example, --services=data,index.

Couchbase's services are specified only when a server is added to the cluster. For a production environment, specify only one service per node. However, for the development environment, more than one service can be enabled on a single node.

Examples

Example 1:

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 --services=data

Example 2:

Adds a node to a cluster and specifies the index and query services. If a Couchbase Server service is not provided, the default (data service) is enabled.

Request

couchbase-cli server-add -c 10.3.2.204:8091 -u Administrator -p password \
--server-add=10.3.4.246:8091 --server-add-username=Administrator \ 
--server-add-password=password --services=data,index   

Response

Request example response:

SUCCESS: server-add 10.3.4.246:8091

Example 3:

If the --group-name option is not specified with the server-add command, the server is added to the default group.

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 --group-name=groupName