How do I pause/unpause shard balancing in MongoDB?

Chris Burton
2014-12-16 22:08

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 );
Tags: disable, enable, mongodb, pause, sharding, unpause
Average rating: 0 (0 Votes)

You cannot comment on this entry