MongoDB Documentation, Release 3.0.4 Determine the Name of the Shard to Remove Remove Chunks from the Shard Check the Status of the Migration Continue checking the status of the removeShard command until the number of chunks remaining is 0 . Always run the command on the admin database. If you are on a database other than admin , you can use sh._adminCommand to run the command on admin . In the output, the remaining document displays the remaining number of chunks that MongoDB must migrate to other shards and the number of MongoDB databases that have “primary” status on this shard. The command returns output similar to the following: To check the progress of the migration at any stage in the process, run removeShard from the admin database again. For example, for a shard named mongodb0 , run: Depending on your network capacity and the amount of data, this operation can take from a few minutes to several days to complete. This operation returns immediately, with the following response: From the admin database, run the removeShard command. This begins “draining” chunks from the shard you are removing to other shards in the cluster. For example, for a shard named mongodb0 , run: The shards._id field lists the name of each shard. To determine the name of the shard, connect to a mongos instance with the mongo shell and either: • Use the listShards command, as in the following: • Run either the sh.status() or the db.printShardingStatus() method. db.adminCommand( { listShards: 1 } ) use admin db.runCommand( { removeShard: "mongodb0" } ) { "msg" : "draining started successfully", "state" : "started", "shard" : "mongodb0", "ok" : 1 } use admin db.runCommand( { removeShard: "mongodb0" } ) { "msg" : "draining ongoing", "state" : "ongoing", "remaining" : { "chunks" : 42, "dbs" : 1 }, "ok" : 1 } Chapter 10. Sharding 720