balancerStatus

Definition

  • balancerStatus

New in version 3.4.

Returns a document that contains information about the status of thebalancer.

You can only issue the balancerStatus against theadmin database.

The command takes the following form:

  1. db.adminCommand( { balancerStatus: 1 } )

Output Document

The following is an example of a document returned by the command:

  1. {
  2. "mode" : "full",
  3. "inBalancerRound" : false,
  4. "numBalancerRounds" : NumberLong(86),
  5. "ok" : 1
  6. }
FieldDescription
"mode"A string that specifies whether the balancer thread is runningor stopped. Possible values are:- - “full” - Balancer thread is running but not necessarily in abalancing round.- - “off” - Balancer thread is stopped. No chunk balancing can occur inthis mode.
"inBalancerRound"A boolean that specifies if the balancer is currently in abalancing round; i.e. distributing chunks.
"numBalancerRounds"The number of balancer rounds which have occurred since theconfig servers were started. This value is not persisted and isreset to 0 upon restart of the config servers.

Example

Connect to a mongos instance and issue the following command:

  1. db.adminCommand( { balancerStatus: 1 } )