发布于 2015-09-14 15:06:38 | 183 次阅读 | 评论: 0 | 来源: 网络整理
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:
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.