This is a REST request made to an individual Couchbase node to add that node to a given cluster. You cannot merge two clusters together into a single cluster using the REST API, however, you can add a single node to an existing cluster. You will need to provide several parameters to add a node to a cluster:
shell> curl -u admin:password -d clusterMemberHostIp=192.168.0.1 \ -d clusterMemberPort=8091 \ -d user=admin -d password=admin123 http://localhost:8091/node/controller/doJoinCluster
The following arguments are required:
Table 8.4. REST API — Cluster Joining Arguments
| Argument | Description |
|---|---|
| clusterMemberHostIp | Hostname or IP address to a member of the cluster the node receiving this POST will be joining |
| clusterMemberPort | Port number for the RESTful interface to the system |
If your cluster requires credentials, you will need to provide the following parameters in your request:
Table 8.5. REST API — Cluster Joining Additional Arguments
| Argument | Description |
|---|---|
| user | Administration user |
| password | Password associated with the Administration user |
POST /node/controller/doJoinCluster Host: localhost:8091 Authorization: Basic xxxxxxxxxxxx Accept: */* Content-Length: xxxxxxxxxx Content-Type: application/x-www-form-urlencoded clusterMemberHostIp=192.168.0.1&clusterMemberPort=8091&user=admin&password=admin123
200 OK with Location header pointing to pool details of pool just joined - successful join 400 Bad Request - missing parameters, etc. 401 Unauthorized - credentials required, but not supplied 403 Forbidden bad credentials - invalid credentials