Skip to content

Instantly share code, notes, and snippets.

@CaptTofu
Created April 19, 2016 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CaptTofu/2202e28bcd9cd429591f2a20a085c4b8 to your computer and use it in GitHub Desktop.
Save CaptTofu/2202e28bcd9cd429591f2a20a085c4b8 to your computer and use it in GitHub Desktop.
mongos> db.locks.find( { _id : "balancer" } ).pretty()
{
"_id" : "balancer",
"state" : 0,
"who" : "ip-172-31-28-205:27018:1461037929:1804289383:Balancer:846930886",
"ts" : ObjectId("5716450a5895fd10a3e9905e"),
"process" : "ip-172-31-28-205:27018:1461037929:1804289383",
"when" : ISODate("2016-04-19T14:47:38.286Z"),
"why" : "doing balance round"
}
mongos> sh.setBalancerState( true )
mongos> db.settings.update( { _id: "balancer" }, { $set: { activeWindow : { start : "00:00", stop: "23:59" }}}, { upsert: true } )
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 0 })
mongos> db.locks.find( { _id : "balancer" } ).pretty()
{
"_id" : "balancer",
"state" : 0,
"who" : "ip-172-31-28-205:27018:1461037929:1804289383:Balancer:846930886",
"ts" : ObjectId("5716451d5895fd10a3e99060"),
"process" : "ip-172-31-28-205:27018:1461037929:1804289383",
"when" : ISODate("2016-04-19T14:47:57.259Z"),
"why" : "doing balance round"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment