Enabling Couchbase Server Services

    +
    Couchbase Server services are enabled when adding or joining a node to a cluster.

    Syntax

    Adding a node syntax:

    curl -u [admin]:[password]
      [localhost]:8091/controller/addNode
      -d "hostname=[IPaddress]&user=[admin]&password=[password]"
      -d "services=[kv | index | n1ql | fts | cbas | eventing]"

    Joining a node to a cluster:

    curl -u [admin]:[password] -d clusterMemberHostIp=[ip-address]
      -d clusterMemberPort=[port]
      -d user=[admin] -d password=[password]
      http://[localhost]:8091/node/controller/doJoinCluster
      -d "services=[kv | index | n1ql | fts | cbas | eventing]"

    Description

    This command is used to add a node to a cluster and specify the service. If a service is not specified, the data service (kv) will be added by default.

    Couchbase Server services can only be enabled via the REST API when adding a server to an existing cluster. To initialize a cluster (with the first node) with any Couchbase Server service other than the default data service (kv), use the Couchbase Web Console.

    When enabling services, ensure that you set the appropriate memory quota parameters as follows:

    curl -X POST -u Administrator:password \
      http://127.0.0.1:8091/pools/default \
      -d 'memoryQuota=256' \
      -d 'indexMemoryQuota=256' \
      -d 'ftsMemoryQuota=512' \
      -d 'cbasMemoryQuota=1048' \
      -d 'eventingMemoryQuota=512'

    HTTP method and URI

    POST /controller/addNode
    POST /node/controller/doJoinCluster

    Example

    Adding a node:

    curl -u Administrator:password \
      10.2.2.60:8091/controller/addNode \
      -d 'hostname=10.2.2.64&user=admin&password=password' \
      -d 'services=index'

    Joining a node to a cluster:

    curl -u Administrator:password -d clusterMemberHostIp=192.168.0.1 \
      -d 'clusterMemberPort=8091' \
      -d 'user=admin' -d 'password=password' \
      http://10.5.2.54:8091/node/controller/doJoinCluster \
      -d 'services=index'