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:

mongo shell v4.4

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描述
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.重新启动配置服务器时,此值将重置为0。
okSee Command Response.请参见命令响应
$clusterTimeSee Command Response.请参见命令响应
operationTimeSee Command Response.请参见命令响应