Remove Shards from the existing Sharded cluster
Important points to be considered before removing the shard from the existing shard cluster Make sure that the shard data is migrated to the other shards successfully. Make sure the balancer is enabled before you run the remove shard. Step-1: find the shard name to be removed To find the name of the shard, connect to mongos instance. db.adminCommand( { listShards: 1 } ) Output: mongos> db.adminCommand( { listShards: 1 } ) { "shards" : [ { "_id" : "replicaset1", "host" : "replicaset1/mysql8.localdomain:27011,mysql8.localdomain:27012,mysql8.localdomain:27013", "state" : 1 }, { "_id" : "replicaset2", "host" : "replicaset2/mysql8.localdomain:27021,mysql8.localdomain:27022,mysql8.localdomain:27023", "state" : 1 }, { "_id" : "replicaset3", "host" : "replicaset3/mysql8.localdomain:27031,mysql8.lo...