How do I pause/unpause shard balancing in MongoDB?

~ 0 min
2014-12-16

During index creations and other long operations it is sometimes helpful to pause shard rebalancing.

To pause/disable sharding connect with the console and run

use config
db.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true );

To unpause/re-enable shard balancing connect to the console again and run

use config
db.settings.update( { _id: "balancer" }, { $set : { stopped: false } } , true );
Average rating 0 (0 Votes)

You cannot comment on this entry