发布于 2015-09-14 15:12:18 | 223 次阅读 | 评论: 0 | 来源: 网络整理

moveChunk

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> } )
参数:
  • moveChunk (namespace) – The name of the collection where the chunk exists. Specify the collection’s full namespace, including the database name.
  • find (document) – A document including the shard key.
  • to (host) – The identifier of the shard, that you want to migrate the chunk to.
  • _secondaryThrottle (boolean) – Optional. Set to false by default. If set to true, the balancer waits for replication to secondaries while copying and deleting data during migrations. For details, see Require Replication before Chunk Migration (Secondary Throttle).

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.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务