Assigning Services to a New Single Node

      +
      Use the REST API to assign services to a new, single-node cluster.

      HTTP Method and URI

      POST /node/controller/setupServices

      Description

      Sets up the services for a one-node cluster, as part of its initial provisioning.

      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