sh.isBalancerRunning()
On this page
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.
Compatibility
This method is available in deployments hosted in the following environments:
MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
Important
This command is not supported in M0, M2, and M5 clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB
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 }) }
Field | Description |
---|---|
mode | String that specifies whether the balancer thread is running or stopped. Possible values are:
|
inBalancerRound | Boolean that specifies if the balancer is currently in a
balancing round. |
numBalancerRounds | Number of balancer rounds which have occurred since the
config servers were started. This value is reset to 0 when
the config servers are restarted. |
ok | |
$clusterTime | |
operationTime |