sh.enableBalancing()
On this page本页内容
Description描述
sh.enableBalancing(namespace)
-
Enables the balancer for the specified namespace of the sharded collection.为分片集合的指定命名空间启用平衡器。ImportantYou can only run您只能在sh.enableBalancing()
on amongos
instance.mongos
实例上运行sh.enableBalancing()
。如果在sh.enableBalancing()
errors if run onmongod
instance.mongod
实例上运行,sh.enableBalancing()
将出错。Thesh.enableBalancing()
method has the following parameter:sh.enableBalancing()
方法具有以下参数:Parameter参数Type类型Description描述namespace
string The namespace of the collection.集合的命名空间。Importantsh.enableBalancing()
does not start balancing.不会开始平衡。Rather, it allows balancing of this collection the next time the balancer runs.相反,它允许在下次平衡器运行时对该集合进行平衡。For more information on the balancing process, see Manage Sharded Cluster Balancer and Sharded Cluster Balancer.有关平衡过程的更多信息,请参阅管理分片群集平衡器和分片群集平衡器。