我正在尝试在MongoDB 4.2中解决复制问题,但是我无法再将主服务器恢复为主服务器,它始终保持在SECONDARY模式。我已经尝试了几种类型的解决方案,例如this或here
但没有成功。
在日志中,我遇到了以下消息:
Scheduling remote command request for vote request: RemoteCommand 729 -- target:mongo2:27021 db:admin cmd:{ replSetRequestVotes: 1, setName: "MyReplicaSet", dryRun: true, term: 2, candidateIndex: 0, configVersion: 125668, lastCommittedOp: { ts: Timestamp(1570799675, 1), t: 2 } }
2019-10-11T11:17:25.041-0300 I ELECTION [replexec-2] VoteRequester(term 2 dry run) received an invalid response from mongo2:27021: NotYetInitialized: no replset config has been received; response message: { operationTime: Timestamp(0, 0), ok: 0.0, errmsg: "no replset config has been received", code: 94, codeName: "NotYetInitialized", $clusterTime: { clusterTime: Timestamp(1570799675, 1), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } } }
2019-10-11T11:17:25.041-0300 I ELECTION [replexec-2] not running for primary, we received insufficient votes
2019-10-11T11:17:25.041-0300 I ELECTION [replexec-2] Lost dry run election due to internal error
该如何解决?