mongodb集群主从节点转移

conf = rs.conf()
{
    "_id" : "rs0",
    "version" : 2,
    "members" : [
        {
            "_id" : 0,
            "host" : "YX-ARCH:27011"
        },
        {
            "_id" : 1,
            "host" : "YX-ARCH:27012"
        }
    ]
}
rs0:PRIMARY> conf.members[1].priority = 2
2
rs0:PRIMARY> rs.reconfig(conf)
Fri Jan 24 15:25:36.069 DBClientCursor::init call() failed
Fri Jan 24 15:25:36.070 trying reconnect to localhost:27011
Fri Jan 24 15:25:36.070 reconnect localhost:27011 ok
reconnected to server after rs command (which is normal)

rs0:SECONDARY>


你可能感兴趣的:(mongodb集群主从节点转移)