Cluster-init mandatory argument

I am trying to automate cluster initialisation where I am running cluster-init using automation.

I am facing an issue that cluster-init has a mandatory argument --cluster-password and providing this password in command line is a security vulnerability where the password is visible in process tree and it gets stored in bash history as well.

Is there any other way to provide such arguments?

The couchbase module for org.testcontainers may satisfy your needs. Or the code may show how to programmatically initialize a cluster.

Most of the couchbase operations have a corresponding REST API. Check the REST API documentation for a cluster-init.

Ref: https://docs.couchbase.com/server/current/rest-api/rest-initialize-cluster.html

1 Like

@dh @mreiche
Thanks for the update. But, using the curl command mentioned in the documentation, the password would still come in bash history.

Perhaps, I should clarify, I am writing a bash script for the automation. So, to access REST API, I would have to use curl which requires the data mentioned above in the command line itself.

But you don’t have to pass curl’s data on the command line. See the curl manual pages - notably the use of -d @/path/to/file for passing data. (Ref: https://curl.se/docs/manpage.html)

And if you use -d @ - it reads from STDIN.

HTH.

Hi, thankyou so much for the quick response. This turns out to be helpful.
But, I just want to confirm one quick thing, I could not find any clusterInit api for couchbase 6.6.

Is it some workaround available for this?

For 6.6 please refer to:

https://docs.couchbase.com/server/6.6/rest-api/rest-node-provisioning.html

HTH.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.