对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

balancerStart(数据库命令)

balancerStart

启动负载均衡器线程。 该命令不会等待均衡轮次开始。

从MongoDB 7.0 开始,启动负载均衡器还会为分片集群启用 AutoMerger

提示

In mongosh, this command can also be run through the sh.startBalancer() helper method.

Helper methods are convenient for mongosh users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.

此命令可用于以下环境中托管的部署:

  • MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务

You can only issue the balancerStart against the admin database on a mongos instance.

该命令具有以下语法:

db.adminCommand(
{
balancerStart: 1,
maxTimeMS: <number>
}
)
字段
类型
说明

balancerStart

any

任何值。

maxTimeMS

整型

可选。 启用负载均衡器的时间限制。

默认为 60000 毫秒。

要启动负载均衡器线程,请连接到mongos实例并发出以下命令:

db.adminCommand( { balancerStart: 1 } )
给本页内容打分