sh.disableAutoSplit

On this page本页内容

Description描述

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(),则它将错误。

Note注意

Starting in MongoDB 4.2, sh.stopBalancer() also disables auto-splitting for the sharded cluster.从MongoDB 4.2开始,sh.stopBalancer()还禁用了分片集群的自动拆分。

←  sh.enableBalancing()sh.enableAutoSplit →