Initializing a Node
A node can be initialized, by means of the REST API.
Initializes a node, prior to its being provisioned as a one-node cluster. This means to establish local paths for on-disk storage required by the Data, Index, Analytics, and Eventing Services; and to establish a local path for a JRE, to be used by the Analytics Service. Once established, these paths continue to be used by the node subsequent to its provisioning with services, memory-allocations, administrator username and password, and other details. Indeed, these paths will continue to be used by the node even subsequent to the node’s addition to another cluster.
If one or more paths are not specified (or if initialization with this interface is left entirely unperformed), defaults are provided when provisioning occurs.
Prior to establishment of username and password by the administrator who is configuring the single-node cluster, initialization can be performed repeatedly, with new values established each time. After establishment of username and password, initialization can no longer be performed.
Per platform, the default data-folder locations for all services are:
curl -X POST http://<node-ip-address-or-domain-name>:8091/nodes/self/controller/settings -u <username>:<password> -d data_path=<data-path> -d index_path=<index-path> -d cbas_path=<analytics-path> -d eventing_path=<eventing-path> -d java_home=<jre-path>
Specified directory paths must be writable by user
If a directory is not writable by user
400 Bad Request is returned, with a message such as:
["Could not set analytics storage. All directories must be writable by 'couchbase' user."].
An incorrectly specified URL or data parameter returns
404 Object Not Found.
An attempt to re-initialize after username and password have been established returns
400 Bad Request, with a message such as:
["Changing paths of nodes that are part of provisioned cluster is not supported"].
The following example establishes the paths for the Data, Index, Analytics, and Eventing Services.
curl -X POST \ http://10.142.181.103:8091/nodes/self/controller/settings \ -d 'data_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fdata&' \ -d 'index_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fidata&' \ -d 'cbas_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fadata&' \ -d 'eventing_path=%2Fopt%2Fcouchbase%2Fvar%2Flib%2Fcouchbase%2Fedata&'
The sequence of tasks divided into initialization and provisioning is explained in Cluster Initialization and Provisioning.
Information on nodes is provided in Nodes.
For further information on initialization and provisioning — using the UI, the CLI, and the REST API — see Manage Nodes and Clusters.