In this recipe, we will look at how to remove a shard from an existing cluster.
We need a sharded cluster, preferably the one we created in the Managing chunks recipe of this chapter.
- Connect to the cluster's mongos service and view the current shards and their respective chunks:
sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "minCompatibleVersion" : 5, "currentVersion" : 6, "clusterId" : ObjectId("59c7950c9be3cff24816915a") } shards: { "_id" : "shard0000", "host" : "192.168.200.200:27027", "state" : 1 } { "_id" : "shard0001", "host" : "192.168.200.200:27028", "state" : 1 } { "_id" : "shard0002", "host" : "192.168.200.200:27029", "state" : 1 } <-- output truncated --> databases: shard0000 2 shard0001 1 shard0002 2 ...