Automation of MongoDB sharded cluster deployment.
Hi,
Is it possible to automate the creation of MongoDB sharded cluster using API/CLI or any other tools? If yes, where can I find any related info?
-
Official comment
Hi!
We are currently and actively working on being able to do this from our CLI (https://severalnines.com/blog/how-use-s9s-command-line-interface-clustercontrol). This will be ready soon.
However, currently you can use our JSON RPC API directly.1) Make sure you have ClusterControl 1.5.0 installed
2) Here is the job how to create a mongodb cluster:
https://severalnines.com/downloads/cmon/cmon-docs/current/cmonjobs.html#mongo
and there are also descriptions there of the params.
3) you can then prepare the json, with the settings you must have.THen you take the job, and put it where i have written **JOBSPEC JSON **. Have the job spec inside quotes.
curl -XPOST -d '{"operation": "createjob", "job": {"command":"create_cluster","job_data": { **JOBSPEC JSON** } }, "token": "CID0_TOKEN"}' http://127.0.0.1:9500/0/job
The value for the "token" you get from :
grep rpc_key /etc/cmon.cnfBest regards
Johan
Comment actions
Please sign in to leave a comment.
Comments
1 comment