Adding Nodes to Clusters

Nodes are added to clusters with the POST /controller/addNode HTTP method and URI.

Syntax

This request adds a server node to the cluster. One or more services can be specified to run on the added node. These are kv (data), index (index), n1ql (query), eventing (eventing), fts (search), and cbas (analytics). If no services are specified, the Data Service is enabled by default. The node is added with the endpoint server_ip:port/controller/addNode endpoint. The administrative username and password must be specified.

curl -u [admin]:[password]
  [localhost]:8091/controller/addNode
  -d hostname=[IPaddress] user=[admin] password=[password] services=[kv|index|n1ql|fts|cbas|eventing]

After adding a node to the cluster, remember to rebalance the cluster. See Rebalancing Nodes for details.

HTTP method and URI

POST /controller/addNode

Example

The following example adds a server node, 10.2.2.64, to the cluster at 10.2.2.60:8091, establishing the Data, Query, and Index Services on the new node. The POST method, controller/addNode, IP address for the new server, and administrative credentials are provided. Since the POST method is the default, it is not required in the request.

curl -u Administrator:password \
  10.2.2.60:8091/controller/addNode \
  -d 'hostname=10.2.2.64&user=Administrator&password=password&services=kv,n1ql,index'

Response

If successful, Couchbase Server responds as follows, identifying the node that has been added:

HTTP/1.1 200 OK
{"otpNode":"ns_1@10.2.2.64"}