我對 rs.reconfig 做了一個小改動,這導致我的主節點卡在了 RECOVERING 狀態。我該如何糾正?
我剛剛使用以下命令從 protocolVersion: Long("1") 更改了 protocolVersion: Long("0") :
rs.reconfig({
_id: 'x',
version: 803461,
protocolVersion: Long("0"),
members: [
{
_id: 1,
host: '10.x.0.x:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 1,
tags: {},
slaveDelay: Long("0"),
votes: 1
},
{
_id: 2,
host: '10.x.0.x:27017',
arbiterOnly: false,
buildIndexes: true,
hidden: false,
priority: 1,
tags: {},
slaveDelay: Long("0"),
votes: 1
}
],
settings: {
chainingAllowed: true,
heartbeatIntervalMillis: 2000,
heartbeatTimeoutSecs: 10,
electionTimeoutMillis: 10000,
catchUpTimeoutMillis: 60000,
getLastErrorModes: {},
getLastErrorDefaults: { w: 1, wtimeout: 0 },
replicaSetId: ObjectId("5a884c37b6ccb139231011c9")
}
})
以前是主要節點的節點
{
_id: 1,
name: '10.x.0.x:27017',
health: 1,
state: 3,
stateStr: 'RECOVERING',
uptime: 804,
optime: [Object],
optimeDate: 2021-12-24T16:39:05.000Z,
infoMessage: 'could not find member to sync from',
configVersion: 803465,
self: true
}
uj5u.com熱心網友回復:
MongoDB 4.0 僅支持協議版本 1。
如果您手動配置了不受支持的版本,您可以使用帶有force:true選項的rs.reconfig 將其更改回來
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/392585.html
標籤:MongoDB
