Initializing a Node
- reference
A node can be initialized, by means of the REST API.
Description
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:
-
Linux:
/opt/couchbase/var/lib/couchbase/data
-
Windows:
C:\Program Files\Couchbase\Server\var\lib\couchbase/data
-
MacOS:
/Library/Application Support/Couchbase/var/lib/couchbase/data
Curl Syntax
curl -X POST http://<node-ip-address-or-domain-name>:8091/nodes/self/controller/settings -u <username>:<password> -d 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 couchbase
.
Responses
Success returns 200 OK
.
If a directory is not writable by user couchbase
, 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"]
.
Example
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 '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&'
See Also
The sequence of tasks divided into initialization and provisioning is explained in Cluster Initialization and Provisioning.
For each of the specific steps required in the provisioning process, see Configuring Memory, Naming a Node, Naming a Cluster, Assigning Services, and Establishing Credentials.
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.