Mongodb – How to remove a corrupted shard in MongoDB

mongodb

I use MongoDB 3.0.3 with Wired Tiger engine on Cent OS 6.4.
I have a sharded cluster of 4 shards each of which has about a quarter of total data.

One of the shard called "shard2" corrupted and can't start.
Without this shard, the cluster can't work.

I can bear losing data on this shard, How can I remove this shard to make the cluster work??
What parameters should I modify in "config" collection?

Best Answer

You can use below commands to remove the shards, though I havn't tried ever but looks straight forward.

use admin
db.runCommand( { removeShard: "mongodb0" } )

--Response
{
    "msg" : "draining started successfully",
    "state" : "started",
    "shard" : "mongodb0",
    "ok" : 1
}

link: http://docs.mongodb.org/manual/tutorial/remove-shards-from-cluster