sh.enableAutoSplit

On this page本页内容

Description描述

sh.enableAutoSplit()

Enables auto-splitting for the sharded cluster. 启用分片群集的自动拆分。Auto-splitting is enabled by default.默认情况下启用自动拆分。

sh.enableAutoSplit() enables the autosplit flag in the config.settings collection.启用config.settings集合中的autosplit标志。

You can only run sh.enableAutoSplit() from a mongosh session that is connected to a mongos instance. 只能从连接到mongos实例的mongosh会话运行sh.enableAutoSplit()sh.enableAutoSplit() errors if run on a mongod instance.如果在mongod实例上运行sh.enableAutoSplit(),则它将出错。

Note注意

Starting in MongoDB 4.2, sh.startBalancer() also enables auto-splitting for the sharded cluster.从MongoDB 4.2开始,sh.startBalancer()还支持自动分割分片集群。

For more information on chunk splits, see Chunk Splits. 有关区块分割的详细信息,请参阅区块分割For more information about how MongoDB balances chunks among shards, see: Manage Sharded Cluster Balancer and Sharded Cluster Balancer.有关MongoDB如何在分片之间平衡块的更多信息,请参阅:管理分片群集平衡器分片群集平均器

←  sh.disableAutoSplitsh.enableSharding() →