Assigning Services to a New Single Node
Use the REST API to assign services to a new, single-node cluster.
Curl Syntax
curl -X POST http://<ip-address-or-domain-name>:8091/node/controller/setupServices \ -d services=<list-of-service-names> -u <username>:password
The list-of-service-names must consist of either:
-
One or more of the following:
kv(Data Service),n1ql(Query Service),index(Index Service),fts(Search Service),eventing(Eventing Service),cbas(Analytics Service),backup(Backup Service). Each name must be separated from the following name with a comma. -
Nothing. For 7.6 and later, this indicates that no service will be set up on the node.
Each assigned service is allocated a default amount of memory, unless custom allocations have been made. See Configuring Memory for information on allocating memory per service, and on the default minimum values per service.
Note that during the process of provisioning a single-node cluster, username and password are required after the administrator has established credentials, as described in Establishing Credentials.
Responses
-
Success returns
200 OK. -
If a username and password have already been assigned, failure to authenticate returns
401 Unauthorized. -
An incorrectly expressed URI returns
404 Object Not Found. -
An incorrect expression of the flag returns
400 Bad Request, and an error message such as the following:{"errors":{"services":"The value must be supplied"}}. -
An incorrectly expressed service-name returns
400 Bad Request, and an error message such as the following:{"errors":{"services":"Unknown services: [\"eve3nting\"]"}}.
Examples
The following example establishes data paths for the Data, Index, and Eventing Services.
curl -X POST -H "Content-Type: application/json" http://10.144.220.101:8091/node/controller/setupServices \ -d '{"services":"kv,n1ql,index,eventing"}' \ -u Administrator:password ---
Or you may choose to URI encode the parameters to ensure the string is not malformed by transport layers. The below example applies URI encoding to the commas.
curl -X POST http://10.144.220.101:8091/node/controller/setupServices \ -d 'services=kv%2Cn1ql%2Cindex%2Ceventing' \ -u Administrator:password
The following example establishes that no service should run on the specified node.
curl -X POST http://10.144.220.101:8091/node/controller/setupServices \ -d 'services=' \ -u Administrator:password
See Also
-
For more information about cluster initialization and provisioning with the REST API, see Cluster Initialization and Provisioning.
-
For each of the other specific steps required in the provisioning process, see Configuring Memory, Naming a Node, Naming a Cluster, and Establishing Credentials. Specifically, see Configuring Memory for information on allocating memory per service, and on the default minimum values per service.
-
For more information on initialization and provisioning — using the UI, the CLI, and the REST API — see Manage Nodes and Clusters.
-
For more information about assigning non-Data Services to an existing node using the REST API, see Assigning Services to an Existing Node.