#### WARNING: This documenmt needs a run through and a few things left too. # You must have run the script Shard.txt and then continue with this. # Now remove the shard and it will drain to the other mongo --quiet --eval 'db.runCommand( { removeShard : "shard0000" })' admin mongo --quiet --eval 'sh.setBalancerState(true)' mongo --quiet --eval 'db.runCommand( { removeShard : "shard0000" })' admin sleep 5 mongo --quiet --eval 'sh.status()' | egrep '\-\->>|state' # Now add the shard back and it should rebalance. mongo --eval 'sh.addShard( "localhost:4001" )' mongo --quiet --eval 'sh.setBalancerState(true)' sleep 2 mongo --quiet --eval 'sh.status()' | egrep '\-\->>|state' mongo --port 4001 --eval "db.no.count()" shard_test mongo --port 4002 --eval "db.no.count()" shard_test # However, you will notice its now shard00002