sh.enableBalancing()

On this page本页内容

Description描述

sh.enableBalancing(namespace)

Enables the balancer for the specified namespace of the sharded collection.为分片集合的指定命名空间启用平衡器。

Important重要

You can only run sh.enableBalancing() on a mongos instance. 只能在mongos实例上运行sh.enableBalancing()sh.enableBalancing() errors if run on mongod instance.如果在mongod实例上运行sh.enableBalancing(),则它将出错。

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

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

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

←  sh.disableBalancing()sh.disableAutoSplit →