On this page本页内容
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()
,则它将出错。
Starting in MongoDB 4.2, 从MongoDB 4.2开始,sh.startBalancer()
also enables auto-splitting for the sharded cluster.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如何在分片之间平衡块的更多信息,请参阅:管理分片群集平衡器和分片群集平均器。