On this page本页内容
sh.disableAutoSplit()
Disables the autosplit flag in the 禁用config.settings
collection. config.settings
集合中的autosplit
标志。When auto-splitting is enabled for a sharded cluster, MongoDB automatically splits chunks based on the shard key values the chunk represents to keep the chunks from growing too large.当为分片集群启用自动拆分时,MongoDB会根据区块表示的分片键值自动拆分区块,以防止区块变得过大。
Auto-splitting is enabled by default. For more information on chunk splits, see Chunk Splits.默认情况下启用自动拆分。有关区块分割的详细信息,请参阅区块分割。
You can only run 只能从连接到sh.disableAutoSplit()
from a mongosh
session that is connected to a mongos
instance. mongos
实例的mongosh
会话中运行sh.disableAutoSplit()
。如果在sh.disableAutoSplit()
errors if run on a mongod
instance.mongod
实例上运行sh.disableAutoSplit()
,则它将错误。
Starting in MongoDB 4.2, 从MongoDB 4.2开始,sh.stopBalancer()
also disables auto-splitting for the sharded cluster.sh.stopBalancer()
还禁用了分片集群的自动拆分。