Adding Nodes to Clusters
Nodes are added to clusters with the POST /controller/addNode
HTTP method and URI.
Syntax
This is a REST request made to a Couchbase Server cluster to add a server node to the cluster with a service: kv (data), index or n1ql (query).
If you add a node with no services specified, the kv (the Data Service) will be enabled by default.
A new node is added with the RESTful endpoint server_ip:port/controller/addNode
.
The administrative username and password parameters are required.
curl -u [admin]:[password] [localhost]:8091/controller/addNode -d hostname=[IPaddress] user=[admin] password=[password] services=[kv|index|n1ql|fts]
After adding a node to the cluster, remember to rebalance the cluster. See Rebalancing Nodes for details.
Example
The following example request adds a server node, 10.2.2.64, to the cluster at 10.2.2.60:8091.
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=n1ql'