Moving shards
#4544
Replies: 1 comment
-
Hi, you need to:
This is an advanced task, sometime it's easier to set up a new cluster and replicate the old data to the new cluster. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I found the documentation about moving shards and got through the first steps by enabling maintenance mode.
I haven't got a ton of experience with JSON but I was wondering how I could update the changelog, by_node and by_range. I feel like the documentation "skips" the CLI for this:
To add a shard to a node, add entries like this to the database metadata’s changelog attribute: ["add", "{range}", "{node-name}"]
It goes rather quick on how about to add that fourth node, if using the example in the documentation.
Okay, but how does this translate into a CLI command using
curl -X PUT -H "Content-type: application/json"
? That's where my knowledge is limited. I tried different things like:curl -X PUT -H "Content-type: application/json" http://{hostname}/_node/_local/_dbs/{dbname} -d '["add","{range}","{node-name}"]'
curl -X PUT -H "Content-type: application/json" http://{hostname}/_node/_local/_dbs/{dbname} -d '["add",{range},{node-name}]'
But it eventually fails and it is either invalid JSON or
{"error":"bad_request","reason":"Document must be a JSON object"}
.I'm sure I'm not entirely using the correct syntax, but after having gone through CouchDB's documentation (and the JSON API page), I am feeling a bit lost. :)
Beta Was this translation helpful? Give feedback.
All reactions