Mongodb remove reference of corrupt shard I have a sharded Mongo 3.0.14 setup


2 QueryRouter
1 Config server
3 Cluster (2 data node + 1 arbiter) each with 2TB


How to remove 3rd cluster without draining process? I am okay with the data loss on cluster 3
You need to go "under the hood". Shutdown everything else than config server (mongoS, mongoD on shards).

At Config server, go to config database and there shards -collection. Remove wanted line (shard).

Then you need to remove other traces to that removed shard, from chunks -collection (but way that your shard still works):

db.chunks.update({"shard":"&lt;your removed shard -name&gt;},{$set:{shard:"&lt;name of you other shard&gt;"}},{multi:true})

and from databases -collection:

db.databases.update({"primary":"&lt;your removed shard -name&gt;},{$set:{"primary":"&lt;name of you other shard&gt;"}},{multi:true})

After that, start everything (expect that removed shard) back online. First data bearing nodes (shards) and then last mongoS.

After that, you can start that "removed" shard as single replica set and mongodump data out and import it back to the cluster.. And you get back your "missing" data.