Rename Mongo Shard

Posted by HeySteve on Server Fault See other posts from Server Fault or by HeySteve
Published on 2014-06-11T01:55:09Z Indexed on 2014/06/11 3:28 UTC
Read the original article Hit count: 164

Filed under:
|

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

© Server Fault or respective owner

Related posts about mongodb

Related posts about sharding