无法修改副本集优先级

时间:2014-03-05 05:09:47

标签: mongodb

我尝试修改辅助MongoDB服务器的优先级。并且优先级仅在两个第一台服务器上更改。

rs.conf()
{
    "_id" : "rs0",
    "version" : 7,
    "members" : [
            {
                    "_id" : 0,
                    "host" : "php01-dc.partkom.local:27017",
                    "priority" : 10
            },
            {
                    "_id" : 1,
                    "host" : "php02-dc.partkom.local:27017",
                    "priority" : 10
            },
            {
                    "_id" : 2,
                    "host" : "mysql02-dc.partkom.local:27017",
                    "arbiterOnly" : true
            },
            {
                    "_id" : 3,
                    "host" : "mysql01-dc.partkom.local:27017",
                    "arbiterOnly" : true
            },
            {
                    "_id" : 4,
                    "host" : "mysql-develop01.partkom.local:27017"
            }
    ]
}

然后我尝试:

cfg = rs.conf()
cfg.members[0].priority = 10
cfg.members[1].priority = 10
cfg.members[2].priority = 1
cfg.members[3].priority = 1
cfg.members[4].priority = 1
rs.reconfig(cfg)

_id 4的优先级成员不会改变:(

我错在哪里?

0 个答案:

没有答案