GitHub user jrmy911 closed a discussion: Moving shards

I found the documentation about [moving 
shards](https://docs.couchdb.org/en/stable/cluster/sharding.html) 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. :) 

GitHub link: https://github.com/apache/couchdb/discussions/4544

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]

Reply via email to