ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs 菜单

sh.isBalancerRunning()

sh.isBalancerRunning()

返回描述负载均衡器状态的文档。

重要

mongosh 方法

本页面提供 mongosh 方法的相关信息。这不是数据库命令或特定语言驱动程序(例如 Node.js)的相关文档。

有关数据库命令,请参阅 balancerStatus 命令。

如需了解 MongoDB API 驱动程序,请参阅特定语言的 MongoDB 驱动程序文档。

此方法可用于以下环境中托管的部署:

重要

M0、M2、M5 和 Flex 集群不支持此命令。有关更多信息,请参阅不支持的命令。

以下是该命令返回的文档示例:

{
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 })
}
字段
说明

mode

String that specifies whether the balancer thread is running or stopped. Possible values are:

  • "full"
    负载均衡器线程正在运行,但不一定处于均衡轮次中。
  • “关闭”
    Balancer thread is stopped. Chunk balancing cannot occur in this mode.

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

另请参阅: