Docs HomeMongoDB Manual

sh.isBalancerRunning()

Definition

sh.isBalancerRunning()

Returns a document describing the status of the balancer.

Important

mongosh Method

This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.

For the database command, see the balancerStatus command.

For MongoDB API drivers, refer to the language-specific MongoDB driver documentation.

For the legacy mongo shell documentation, refer to the documentation for the corresponding MongoDB Server release:

Output Document

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

{
  mode: 'full',
  inBalancerRound: false,
  numBalancerRounds: Long("1143"),
  ok: 1,
  '$clusterTime': {
     clusterTime: Timestamp({ t: 1639753724, i: 3 }),
     signature: {
        hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0),
        keyId: Long("0")
     }
  },
  operationTime: Timestamp({ t: 1639753724, i: 3 })
}
FieldDescription
modeString that specifies whether the balancer thread is running or stopped. Possible values are:
  • "full"
    Balancer thread is running but not necessarily in a balancing round.
  • "off"
    Balancer thread is stopped. Chunk balancing cannot occur in this mode.
inBalancerRoundBoolean that specifies if the balancer is currently in a balancing round.
numBalancerRoundsNumber of balancer rounds which have occurred since the config servers were started. This value is reset to 0 when the config servers are restarted.
okSee Command Response.
$clusterTimeSee Command Response.
operationTimeSee Command Response.