说明
sh.enableBalancing(namespace)为分片collection的指定命名空间启用负载均衡器。
重要
You can only run
sh.enableBalancing()on amongosinstance.sh.enableBalancing()errors if run onmongodinstance.The
sh.enableBalancing()method has the following parameter:Parameter类型说明namespace字符串
集合的命名空间。
重要
sh.enableBalancing()does not start balancing. Rather, it allows balancing of this collection the next time the balancer runs.有关均衡过程的更多信息,请参阅“托管分片集群负载均衡器”和“分片集群负载均衡器”。
兼容性
此方法可用于以下环境中托管的部署:
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本