sh.enableBalancing()

在本页面

Description

  • sh. enableBalancing(* namespace *)
    • 为分片集合的指定名称空间启用平衡器。

Important

您只能在mongos实例上运行sh.enableBalancing()。如果在mongod实例上运行,则sh.enableBalancing()错误。

sh.enableBalancing()方法具有以下参数:

ParameterTypeDescription
namespacestring集合的namespace

Important

sh.enableBalancing()不“开始”平衡。相反,它允许平衡器下次运行时平衡该集合。

有关平衡过程的更多信息,请参见Management 分片集群平衡器分片集群平衡器