Adding Servers to Server Groups

Adding Servers to Server Groups

Servers are added to server groups with the POST /pools/default/serverGroups/<:uuid>/addNode HTTP method and URI.

HTTP method and URI

POST /pools/default/serverGroups/<:uuid>/addNode adds a server to a cluster and assigns it to the specified server group, with the specified services (defaulting to data if not provided).

POST /pools/default/serverGroups/<:uuid>/addNode

Syntax

curl -X POST -d hostname=<host>:<port> -d services=<kv|index|n1ql|fts> -d user=<administrator> -d password=<password> 
  -u <administrator>:<password> 
  http://<host>:<port>/pools/default/serverGroups/<uuid>/addNode

Example

curl -X POST -d hostname=192.168.0.2:8091 -d services=n1ql%2Cindex \
  -d user=myAdmin -d password=myPassword \ 
  -u myAdmin:myPassword \ 
  http://192.168.0.1:8091/pools/default/ \
  serverGroups/246b5de857e100dbfd8b6dee0406420a/addNode

The server group’s UUID is in the group information

"name":"Group 2",
"uri":"/pools/default/serverGroups/d55339548767ceb51b241c61e3b9f036",
"addNodeURI":"/pools/default/serverGroups/d55339548767ceb51b241c61e3b9f036/addNode",