0

各位大佬,一个复制集初始化的问题已经困扰我两周。各种百度、google搜索无果。

复制集初始化时“InitialSyncOplogSourceMissing”导致全部节点在startup上,一段时间后,各节点数据库服务关闭

日志显示:

“InitialSyncOplogSourceMissing: No valid sync source found in current replica set to do an initial sync.”

复制集状态:

rs.status()
{
“set” : “stock”,
“date” : ISODate(“2021-08-12T06:13:40.213Z”),
“myState” : 5,
“term” : NumberLong(0),
“syncSourceHost” : “”,
“syncSourceId” : -1,
“heartbeatIntervalMillis” : NumberLong(2000),
“majorityVoteCount” : 2,
“writeMajorityCount” : 2,
“votingMembersCount” : 3,
“writableVotingMembersCount” : 2,
“optimes” : {
“lastCommittedOpTime” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“lastCommittedWallTime” : ISODate(“1970-01-01T00:00:00Z”),
“appliedOpTime” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“durableOpTime” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“lastAppliedWallTime” : ISODate(“1970-01-01T00:00:00Z”),
“lastDurableWallTime” : ISODate(“1970-01-01T00:00:00Z”)
},
“lastStableRecoveryTimestamp” : Timestamp(0, 0),
“initialSyncStatus” : {
“failedInitialSyncAttempts” : 3,
“maxFailedInitialSyncAttempts” : 10,
“initialSyncStart” : ISODate(“2021-08-12T06:13:02.234Z”),
“totalInitialSyncElapsedMillis” : 37979,
“initialSyncAttempts” : [
{
“durationMillis” : 0,
“status” : “InitialSyncOplogSourceMissing: No valid sync source found in current replica set to do an initial sync.”,
“syncSource” : “:27017”,
“operationsRetried” : 0,
“totalTimeUnreachableMillis” : 0
},
{
“durationMillis” : 0,
“status” : “InitialSyncOplogSourceMissing: No valid sync source found in current replica set to do an initial sync.”,
“syncSource” : “:27017”,
“operationsRetried” : 0,
“totalTimeUnreachableMillis” : 0
},
{
“durationMillis” : 0,
“status” : “InitialSyncOplogSourceMissing: No valid sync source found in current replica set to do an initial sync.”,
“syncSource” : “:27017”,
“operationsRetried” : 0,
“totalTimeUnreachableMillis” : 0
}
]
},”members” : [
{
“_id” : 0,
“name” : “khadas:27017”,
“health” : 1,
“state” : 5,
“stateStr” : “STARTUP2”,
“uptime” : 71,
“optime” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“optimeDate” : ISODate(“1970-01-01T00:00:00Z”),
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“configVersion” : 1,
“configTerm” : 0,
“self” : true,
“lastHeartbeatMessage” : “”
},
{
“_id” : 1,
“name” : “hujing:27017”,
“health” : 0,
“state” : 8,
“stateStr” : “(not reachable/healthy)”,
“uptime” : 0,
“optime” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“optimeDurable” : {
“ts” : Timestamp(0, 0),
“t” : NumberLong(-1)
},
“optimeDate” : ISODate(“1970-01-01T00:00:00Z”),
“optimeDurableDate” : ISODate(“1970-01-01T00:00:00Z”),
“lastHeartbeat” : ISODate(“2021-08-12T06:13:33.079Z”),
“lastHeartbeatRecv” : ISODate(“1970-01-01T00:00:00Z”),
“pingMs” : NumberLong(0),
“lastHeartbeatMessage” : “Couldn’t get a connection within the time limit of 500ms”,
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“configVersion” : -1,
“configTerm” : -1
},
{
“_id” : 2,
“name” : “lanjing:27017”,
“health” : 1,
“state” : 7,
“stateStr” : “ARBITER”,
“uptime” : 38,
“lastHeartbeat” : ISODate(“2021-08-12T06:13:39.920Z”),
“lastHeartbeatRecv” : ISODate(“1970-01-01T00:00:00Z”),
“pingMs” : NumberLong(5),
“lastHeartbeatMessage” : “”,
“syncSourceHost” : “”,
“syncSourceId” : -1,
“infoMessage” : “”,
“configVersion” : 1,
“configTerm” : 0
}
],
“ok” : 1
}

这是什么原因?如何解决?能够帮忙解答,万分感谢!!!

已回答的问题