Merge Chunks in a Sharded Cluster
Changed in version 3.0.
mergeChunks command allows you to combine continuous chunks on the same shard into a single chunk. This tutorial explains how to merge neighboring chunks in a sharded cluster.
In the output, the chunk ranges appear after the chunk counts for each sharded collection, as in the following example:
The chunk ranges appear after the chunk counts for each sharded collection. For example, the following are the chunk ranges for the
Merge contiguous chunks on the same shard.
For example, consider the following chunk ranges on
The chunks to be merged are highlighted.
To merge the highlighted contiguous chunks, issue the
mergeChunks command against the
mergeChunks produces the following output:
On any failure condition,
mergeChunks returns a document where the value of the
ok field is