Rename Mongo Shard
- by HeySteve
Can I, and if I can, how can I rename a shard in Mongo?
Like if I wanted to change the instances of rs0 to rep0 below:
mongos> sh.status()
--- Sharding Status ---
sharding version: {
"_id" : 1,
"version" : 4,
"minCompatibleVersion" : 4,
"currentVersion" : 5,
"clusterId" : ObjectId("111111111111")
}
shards:
{ "_id" : "rs0", "host" : "rs0/mongo0a:27017,mongo0b:27017" }
...
I have thought about removing and re-adding the shard, but I'm not sure how I'd do that without having to drain the shard and drop dbs.
Currently 0 of the collections have sharding enabled, I just have a few standalones added as shards.
Thanks