Docs HomeMongoDB Manual

sh.disableAutoSplit

On this page本页内容

Note

Starting in MongoDB 6.1, automatic chunk splitting is not performed. 从MongoDB 6.1开始,不执行自动区块分割。This is because of balancing policy improvements. 这是因为平衡政策的改进。Auto-splitting commands still exist, but do not perform an operation. 自动拆分命令仍然存在,但不执行操作。For details, see Balancing Policy Changes.有关详细信息,请参阅平衡策略更改

Description描述

sh.disableAutoSplit()

Disables the autosplit flag in the config.settings collection. 禁用config.settings集合中的自动拆分标志。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会根据区块所代表的分片键值自动分割区块,以防止区块过大。

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 6.1, automatic chunk splitting is not performed. 从MongoDB 6.1开始,不执行自动区块分割。This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. 这是因为平衡政策的改进。自动拆分命令仍然存在,但不执行操作。For details, see Balancing Policy Changes.有关详细信息,请参阅平衡策略更改

In MongoDB versions earlier than 6.1, sh.stopBalancer() also disables auto-splitting for the sharded cluster.在6.1之前的MongoDB版本中,sh.stopBalancer()还禁用了分片集群的自动拆分。