发布于 2015-09-14 15:06:38 | 169 次阅读 | 评论: 0 | 来源: 网络整理

movePrimary

In a sharded cluster, this command reassigns the database’s primary shard, which holds all un-sharded collections in the database. movePrimary is an administrative command that is only available for mongos instances. Only use movePrimary when removing a shard from a sharded cluster.

重要

Only use movePrimary when:

  • the database does not contain any collections with data, or
  • you have drained all sharded collections using the removeShard command.

See 从现有的片式集群中删除分片 for a complete procedure.

movePrimary changes the primary shard for this database in the cluster metadata, and migrates all un-sharded collections to the specified shard. Use the command with the following form:

{ movePrimary : "test", to : "shard0001" }

When the command returns, the database’s primary location will shift to the designated shard. To fully decommission a shard, use the removeShard command.

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

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