moveChunk is an internal administrative command that moves chunks between shards. You must issue the moveChunk command via a mongos instance while using the admin database in the following form:
db.runCommand( { moveChunk : <namespace> ,
find : <query> ,
to : <destination>,
<options> } )
| Parameters: |
|
|---|
The chunk migration section describes how chunks move between shards on MongoDB.
moveChunk returns the following message if another metadata operation is in progress chunks collection:
errmsg: "The collection's metadata lock is already taken."
If another process, such as a balancer process, changes meta data while moveChunk is running, you may see this error. You may retry the moveChunk operation without side effects.
注意
Only use the moveChunk in special circumstances such as preparing your sharded cluster for an initial ingestion of data, or a large bulk import operation. In most cases allow the balancer to create and balance chunks in sharded clusters. See Create Chunks (Pre-Splitting) for more information.
另见