balancerStatus
On this page
Definition
balancerStatus
New in version 3.4.
Returns a document that contains information about the status of the balancer.
You can only issue the
balancerStatus
against theadmin
database.Tip
In the
mongo
Shell, this command can also be run through thesh.isBalancerRunning()
helper method.Helper methods are convenient for
mongo
users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.The command takes the following form:
db.adminCommand( { balancerStatus: 1 } )
Output Document
The following is an example of a document returned by the command:
{ "mode" : "full", "inBalancerRound" : false, "numBalancerRounds" : NumberLong(86), "ok" : 1 }
Field | Description |
---|---|
"mode" | A string that specifies whether the balancer thread is running or stopped. Possible values are:
|
"inBalancerRound" | A boolean that specifies if the balancer is currently in a
balancing round; i.e. distributing chunks. |
"numBalancerRounds" | The number of balancer rounds which have occurred since the
config servers were started. This value is not persisted and is
reset to 0 upon restart of the config servers. |
Example
Connect to a mongos
instance and issue the following command:
db.adminCommand( { balancerStatus: 1 } )