Docs HomeMongoDB Manual

sh.disableBalancing()

On this page本页内容

Description描述

sh.disableBalancing(namespace)

Disables the balancer for the specified sharded collection. 禁用指定分片集合的平衡器。This does not affect the balancing of chunks for other sharded collections in the same cluster.这不会影响同一集群中其他分片集合的的平衡。

Important

You can only run sh.disableBalancing() on a mongos instance. sh.disableBalancing() errors if run on mongod instance.您只能在mongos实例上运行sh.disableBalancing()。如果在mongod实例上运行,则会出现sh.disableBalancing()错误。

The sh.disableBalancing() method has the following parameter:sh.disableBalancing()方法具有以下参数:

Parameter参数Type类型Description描述
namespacestringThe namespace of the collection.集合的命名空间

For more information on the balancing process, see Manage Sharded Cluster Balancer and Sharded Cluster Balancer.有关平衡过程的更多信息,请参阅管理分片群集平衡器分片群集平衡器