Couchbase-cli : check if a cluster has been set up

#1

After running the Couchbase installer, how can I check if the console setup steps has already been run ? Is couchbase-cli the right tool for this need.

I would like to automate the server installation and only use couchbase-cli to perform the cluster setup.

Should I use Node-Init (to set data paths) first and next use Cluster-Init ?
If I do the opposite, I have the following error :
unable to init localhost (400) Bad Request
{u’error’: u’Changing data of nodes that are part of provisioned cluster is not supported’}

The command lines are :

couchbase-cli.exe node-init -u **** -p **** -c localhost:8091 --node-init-data-path=“D:\CouchbaseData” --node-init-index-path=“D:\CouchbaseData”’

and

couchbase-cli.exe cluster-init -u **** -p **** -c localhost:8091 --cluster-ramsize=256’

Thanks in advance.

#2

You want to use the CLI try “server-list” option.
http://docs.couchbase.com/admin/admin/CLI/CBcli/cbcli-commands.html
or
if you want that info via REST and JSON try
"# curl -k https://HOSTNAME:18091/pools/default/ -u admin_user:admin_password"

#3

Yep that seems to do the trick :smile:
With no server in the cluster the result is the following:
ERROR: command: server-list: localhost:8091, 'error_msg’
With at least one server it is:
ns_1@127.0.0.1 127.0.0.1:8091 healthy active

BTW to fully initialize the server I had to run in order:

  1. node-init
  2. cluster-init
  3. bucket-create