On this page本页内容
sh.stopBalancer(timeout, interval)
Changed in version 4.2.在版本4.2中更改。
Disables the balancer in a sharded cluster. 禁用分片群集中的平衡器。Starting in MongoDB 4.2, 从MongoDB 4.2开始,sh.stopBalancer()
also disables auto-splitting for the sharded cluster.sh.stopBalancer()
还禁用了分片集群的自动拆分。
The method can take the following options:该方法可以采用以下选项:
timeout | integer |
mongo shell with earlier version sharded clusters, the parameter specifies the amount of milliseconds to wait for the balancing round to stop.mongo shell,该参数指定等待平衡轮停止的毫秒数。
|
interval | integer |
mongo shell with earlier version sharded clusters.mongo shell与早期版本的分片集群配合使用。
|
You can only run 只能在sh.stopBalancer()
on a mongos
instance. mongos
实例上运行sh.stopBalancer()
。如果在sh.stopBalancer()
errors if run on mongod
instance.mongod
实例上运行,sh.stopBalancer()
会出错。
The mongo
shell method is a wrapper around the balancerStop
command, introduced in 3.4.mongo
shell方法是3.4中引入的balancerStop
命令的包装器。
If a balancing round is in progress, the operation waits for balancing to complete.如果正在进行平衡回合,操作将等待平衡完成。