sh.enableAutoSplit
On this page本页内容
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.enableAutoSplit()-
Enables the autosplit flag in the启用config.settingscollection.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.enableAutoSplit()from amongoshsession that is connected to amongosinstance.mongos实例的mongosh会话中运行sh.enableAutoSplit()。如果在sh.enableAutoSplit()errors if run on amongodinstance.mongod实例上运行,则会出现sh.enableAutoSplit()错误。NoteStarting in MongoDB 6.1, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation.从MongoDB 6.1开始,不执行自动区块分割。这是因为平衡政策的改进。自动拆分命令仍然存在,但不执行操作。For details, see Balancing Policy Changes.有关详细信息,请参阅平衡策略更改。In MongoDB versions earlier than 6.1,在6.1之前的MongoDB版本中,sh.startBalancer()also enables auto-splitting for the sharded cluster.sh.startBalancer()还支持对分片集群进行自动拆分。Tip