我会提供一个严重的赏金,但所有我的观点都是这样的:(
我在不同的服务器上运行一个3节点的MongoDB副本集(1个主节点,1个从节点,1个仲裁器)。 我正在自动故障转移,确保我的奴隶将被提升到正确的掌握。 当我把主人下来,奴隶接任主人后,我按照指示重新选举我的老主人回到主人( 强迫一个成员为主 )。 从我的新主angular,我跑了:
> use admin > db.auth("admin", "mypassword") > config = rs.conf() { "_id" : "foo", "version" : 1, "members" : [ { "_id" : 0, "host" : "A", }, { "_id" : 1, "host" : "B", }, { "_id" : 2, "host" : "C", } ] } > config.version++ > // the default priority is 1 > config.members[1].priority = 2 > rs.reconfig(config)
这扔了一个错误,所以我尝试了方法#2:
db.adminCommand({replSetStepDown:1000000, force:1})
这似乎弄乱了我的服务器,导致没有服务器被提升为主要和我的老主人和仲裁者开始接收以下错误:
Mon Aug 29 19:16:22 [rs Manager] replset msgReceivedNewConfig version: version: 2 Mon Aug 29 19:16:22 [rs Manager] replSet info saving a newer config version to local.system.replset Mon Aug 29 19:16:22 [rs Manager] Server::doWork task:rs Manager exception:unauthorized db:local lock type:2 client:(NONE) Mon Aug 29 19:16:22 [initandlisten] connection accepted from 192.168.139.50:28130 #476 Mon Aug 29 19:16:22 [initandlisten] connection accepted from 192.168.132.14:32014 #477 Mon Aug 29 19:16:23 [initandlisten] connection accepted from 192.168.139.50:28133 #478 Mon Aug 29 19:16:23 [initandlisten] connection accepted from 192.168.139.50:28136 #479 Mon Aug 29 19:16:23 [initandlisten] connection accepted from 192.168.132.14:32017 #480 Mon Aug 29 19:16:24 [initandlisten] connection accepted from 192.168.139.50:28139 #481 Mon Aug 29 19:16:24 [rs Manager] replset msgReceivedNewConfig version: version: 2 Mon Aug 29 19:16:24 [rs Manager] replSet info saving a newer config version to local.system.replset Mon Aug 29 19:16:24 [rs Manager] Server::doWork task:rs Manager exception:unauthorized db:local lock type:2 client:(NONE) Mon Aug 29 19:16:24 [rs Manager] replSet info not electing self, we are not freshest Mon Aug 29 19:16:24 [initandlisten] connection accepted from 192.168.139.50:28142 #482 Mon Aug 29 19:16:24 [initandlisten] connection accepted from 192.168.132.14:32020 #483 Mon Aug 29 19:16:25 [initandlisten] connection accepted from 192.168.139.50:28145 #484 Mon Aug 29 19:16:25 [initandlisten] connection accepted from 192.168.139.50:28148 #485 Mon Aug 29 19:16:25 [initandlisten] connection accepted from 192.168.132.14:32023 #486 Mon Aug 29 19:16:26 [initandlisten] connection accepted from 192.168.139.50:28151 #487
一些谷歌search后,我发现这是一个与ReplicaSets的错误:
关于我的设置的一些信息:
journal = true keyFile = /path/to/file 正如记者在这个问题上更新的那样,这被报告为一个错误,并且已经在一个较新版本的软件中被修复。
报告/修正了这里的错误: https : //jira.mongodb.org/browse/SERVER-2919
这个问题应该标记为回答/closures。