MongoDB Documentation, Release 3.0.4 db.locks.find( { _id : "balancer" } ).pretty() When this command returns, you will see output like the following: This output confirms that: In some situations, particularly when your data set grows slowly and a migration can impact performance, it’s useful to be able to ensure that the balancer is active only at certain times. Use the following procedure to specify a window during which the balancer will be able to migrate chunks: The balancer will not activate if in the stopped state or outside the activeWindow timeframe. Replace <start-time> and <end-time> with time values using two digit hour and minute values (i.e. HH:MM ) that specify the beginning and end boundaries of the balancing window. The start and stop times will be evaluated relative to the time zone of each individual mongos instance in the sharded cluster. If your mongos instances are physically located in different time zones, use a common time zone (e.g. GMT) to ensure that the balancer window is interpreted correctly. For instance, running the following will force the balancer to run between 11PM and 6AM local time only: • For HH values, use hour values ranging from 00 - 23 . • For MM value, use minute values ranging from 00 - 59 . 4. Use an operation modeled on the following update() operation to modify the balancer’s window: 3. Issue the following operation to ensure the balancer is not in the stopped state: 2. Issue the following command to switch to the Config Database (page 737): 1. Connect to any mongos in the cluster using the mongo shell. • The value in the state field indicates that a mongos has the lock. For version 2.0 and later, the value of an active lock is 2 ; for earlier versions the value is 1 . • The balancer originates from the mongos running on the system with the hostname mongos0.example.net . { "_id" : "balancer", "process" : "mongos0.example.net:1292810611:1804289383", "state" : 2, "ts" : ObjectId("4d0f872630c42d1978be8a2e"), "when" : "Mon Dec 20 2010 11:41:10 GMT-0500 (EST)", "who" : "mongos0.example.net:1292810611:1804289383:Balancer:846930886", "why" : "doing balance round" } db.settings.update( { _id: "balancer" }, { $set: { activeWindow : { start : "<start-time>", stop : "<stop-time>" } } }, { upsert: true } ) use config sh.setBalancerState( true ) Schedule the Balancing Window Chapter 10. Sharding 716