Description
The command for initializing a Couchbase cluster node node-init has an argument (-c / --cluster) for taking the cluster URL as input as shown below:
couchbase-cli node-init [--cluster <url>] [--username <user>]
|
[--password <password>] [--node-init-data-path <path>]
|
[--node-init-index-path <path>] [--node-init-hostname <hostname>]
|
For example:
/opt/couchbase/bin/couchbase-cli node-init -c $DATA_NODE_IP:8091--node-init-data-path=/opt/couchbase/var/lib/couchbase/data -u Administrator -p password |
As per the documentation, the cluster URL specifies the following:
-c --cluster
|
Specifies the hostname of a node in the cluster. See the HOST FORMATS section for more information on specifying a hostname. |
This option is causing a confusion with respect to the value that needs to be passed to it.
The expected value that needs to be passed to this argument "-c / --cluster" during a node initialization, is the IP address of the node on which the node initialization takes place. However, this argument causes a confusion where "-c"/"–cluster" can even denote the cluster URL of an existing cluster to which this node needs to be added.
The server-add command also has the same command line argument "-c / --cluster" that expects the cluster URL of an existing cluster to which a node has to be added.
For node-init, the argument can be changed from "c/cluster" to something more meaningful like "-node" to ensure that there is no confusion with respect to the value that needs to be passed to it:
/opt/couchbase/bin/couchbase-cli node-init -node $DATA_NODE_IP:8091--node-init-data-path=/opt/couchbase/var/lib/couchbase/data -u Administrator -p password |
We already have precedent for removing 'global' options such as username and password for reset-admin-password, this would be another example of adjusting the defaults to make the API clearer.