当更新修改复制集配置的时候,我们通过 members 的 数组下标 (array index)来指定需要修改的节点。数组下标从 0 开始。不要将数组下标与 members 中的 _id 字段混淆了。
警告
The rs.reconfig() shell method can force the current
primary to step down, which causes an election. When the primary steps down, the
mongod closes all client connections. While this
typically takes 10-20 seconds, try to make these changes during
scheduled maintenance periods.