发布于 2015-09-14 15:12:18 | 226 次阅读 | 评论: 0 | 来源: 网络整理
moveChunk is an internal administrative command that moves chunks between shards. You must issue the moveChunk command against the admin database in the form:
db.runCommand( { moveChunk : <namespace> ,
find : <query> ,
to : <destination>,
<options> } )
参数: |
|
---|
Use the sh.moveChunk() helper in the mongo shell to migrate chunks manually.
The chunk migration section describes how chunks move between shards on MongoDB.
moveChunk will return the following if another cursor is using the chunk you are moving:
errmsg: "The collection's metadata lock is already taken."
These errors usually occur when there are too many open cursors accessing the chunk you are migrating. You can either wait until the cursors complete their operation or close the cursors manually.
注解
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. See Create Chunks (Pre-Splitting) for more information.