To manually migrate a chunk, use the following command:
db.adminCommand( { moveChunk : DB.COLLECTION, find : QUERY, to : TARGET } )
The parameters are summarized as follows:
- DB.COLLECTIONÂ (string): This string represents the name of the database, and collection name, separated by a period.
- QUERYÂ (JSON): You can specify a JSON document that describes the shard key field/value key pair considered the lower bound of the chunk to be migrated.
- TARGETÂ (string): This is a string representing the shard server to which the chunk is moved.
The process of determining the best query document is identical to that described in the previous sub-section when determining a split point.
Use this command only if system performance is severely compromised. Be sure to stop the sharded cluster balancer before performing this action. It is considered a best practice to leave chunk migration to the sharded cluster balancer.
The last topic to cover is backup and restore...