splitChunk
Definition
splitChunk
- An internal administrative command. To split chunks, usethe
sh.splitFind()
andsh.splitAt()
functionsin themongo
shell.
Warning
Be careful when splitting data in a sharded collection to createnew chunks. When you shard a collection that has existing data,MongoDB automatically creates chunks to evenly distribute thecollection. To split data effectively in a sharded cluster you mustconsider the number of documents in a chunk and the averagedocument size to create a uniform chunk size. When chunks haveirregular sizes, shards may have an equal number of chunks but havevery different data sizes. Avoid creating splits that lead to acollection with differently sized chunks.
See also
moveChunk
and sh.moveChunk()
.
The splitChunk
command takes a document with the following fields:
FieldTypeDescriptionns
stringThe complete namespace of the chunk to split.keyPattern
documentThe shard key.min
documentThe lower bound of the shard key for the chunk to split.max
documentThe upper bound of the shard key for the chunk to split.from
stringThe shard that owns the chunk to split.splitKeys
documentThe split point for the chunk.shardId
documentThe shard.