On this page本页内容
balancerStart
Starts the balancer thread. 启动平衡器线程。The command does not wait for a balancing round to start.该命令不会等待平衡轮开始。
Starting in MongoDB 4.2, the command enables auto-splitting for the sharded cluster. 从MongoDB 4.2开始,该命令启用分片集群的自动拆分。To disable auto-splitting when the balancer is enabled, you can use 要在启用平衡器时禁用自动拆分,可以使用sh.disableAutoSplit()
.sh.disableAutoSplit()
。
You can only issue the 您只能针对balancerStart
against the admin
database on a mongos
instance.mongos
实例上的admin
数据库发出balancerStart
。
The command takes the following form:该命令采用以下形式:
db.adminCommand( { balancerStart: 1, maxTimeMS: <number> } )
balancerStart | any | |
maxTimeMS | integer |
mongo shell with earlier version sharded clusters, the parameter specifies the amount of time to wait for the balancing round to start.mongo shell与早期版本的分片集群一起使用,则该参数指定等待平衡轮开始的时间。
|
To start the balancer thread, connect to a 要启动平衡器线程,请连接到mongos
instance and issue the following command:mongos
实例并发出以下命令:
db.adminCommand( { balancerStart: 1 } )