Estou tentando configurar uma réplica primária-secundária. Isso é para fazer uma migração sem tempo de inatividade do primeiro nó para o segundo nó nos próximos dias.
O nó primário foi configurado, a configuração foi atualizada, adicionei o keyfile. Fiz o mesmo com o nó secundário.
Também inicializei a replicação, adicionei o nó secundário à replicação. Posso ver um ping e uptime, mas o nó secundário está preso em “STARTUP”.
No entanto, não há configuração de réplica no nó secundário. Além disso, ele está vomitando isso em todo o log de erros repetidamente.
Nó Secundário (Logs):
{"t":{"$date":"2024-11-14T11:35:14.018+00:00"},"s":"I", "c":"CONNPOOL", "id":22576, "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}
{"t":{"$date":"2024-11-14T11:35:14.818+00:00"},"s":"W", "c":"SHARDING", "id":7012500, "ctx":"QueryAnalysisConfigurationsRefresher","msg":"Failed to refresh query analysis configurations, will try again at the next interval","attr":{"error":"PrimarySteppedDown: No primary exists currently"}}
{"t":{"$date":"2024-11-14T11:35:15.000+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found."},"stats":{},"cmd":{"aggregate":"oplog.rs","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"local"}}}
{"t":{"$date":"2024-11-14T11:35:15.000+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found."},"stats":{},"cmd":{"aggregate":"transactions","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:15.001+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found."},"stats":{},"cmd":{"aggregate":"image_collection","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:15.018+00:00"},"s":"I", "c":"CONNPOOL", "id":22576, "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}
{"t":{"$date":"2024-11-14T11:35:16.000+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found."},"stats":{},"cmd":{"aggregate":"oplog.rs","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"local"}}}
{"t":{"$date":"2024-11-14T11:35:16.000+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found."},"stats":{},"cmd":{"aggregate":"transactions","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:16.001+00:00"},"s":"W", "c":"QUERY", "id":23799, "ctx":"ftdc","msg":"Aggregate command executor error","attr":{"error":{"code":26,"codeName":"NamespaceNotFound","errmsg":"Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found."},"stats":{},"cmd":{"aggregate":"image_collection","cursor":{},"pipeline":[{"$collStats":{"storageStats":{"waitForLock":false,"numericOnly":true}}}],"$db":"config"}}}
{"t":{"$date":"2024-11-14T11:35:16.018+00:00"},"s":"I", "c":"CONNPOOL", "id":22576, "ctx":"ReplNetwork","msg":"Connecting","attr":{"hostAndPort":"Ubuntu-2204-jammy-amd64-base:27017"}}
rs.config() no primário
{
set: 'rs0',
date: ISODate('2024-11-14T11:36:01.498Z'),
myState: 1,
term: Long('3'),
syncSourceHost: '',
syncSourceId: -1,
heartbeatIntervalMillis: Long('2000'),
majorityVoteCount: 1,
writeMajorityCount: 1,
votingMembersCount: 1,
writableVotingMembersCount: 1,
optimes: {
lastCommittedOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
lastCommittedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
readConcernMajorityOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
appliedOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
durableOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
writtenOpTime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
lastAppliedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
lastDurableWallTime: ISODate('2024-11-14T11:36:01.474Z'),
lastWrittenWallTime: ISODate('2024-11-14T11:36:01.474Z')
},
lastStableRecoveryTimestamp: Timestamp({ t: 1731584157, i: 2 }),
electionCandidateMetrics: {
lastElectionReason: 'electionTimeout',
lastElectionDate: ISODate('2024-11-14T09:11:55.719Z'),
electionTerm: Long('3'),
lastCommittedOpTimeAtElection: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
lastSeenWrittenOpTimeAtElection: { ts: Timestamp({ t: 1731575489, i: 10 }), t: Long('2') },
lastSeenOpTimeAtElection: { ts: Timestamp({ t: 1731575489, i: 10 }), t: Long('2') },
numVotesNeeded: 1,
priorityAtElection: 1,
electionTimeoutMillis: Long('10000'),
numCatchUpOps: Long('0'),
newTermStartDate: ISODate('2024-11-14T09:11:55.790Z'),
wMajorityWriteAvailabilityDate: ISODate('2024-11-14T09:11:55.803Z')
},
members: [
{
_id: 0,
name: 'Ubuntu-2204-jammy-amd64-base:27017',
health: 1,
state: 1,
stateStr: 'PRIMARY',
uptime: 8656,
optime: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
optimeDate: ISODate('2024-11-14T11:36:01.000Z'),
optimeWritten: { ts: Timestamp({ t: 1731584161, i: 5 }), t: Long('3') },
optimeWrittenDate: ISODate('2024-11-14T11:36:01.000Z'),
lastAppliedWallTime: ISODate('2024-11-14T11:36:01.474Z'),
lastDurableWallTime: ISODate('2024-11-14T11:36:01.474Z'),
lastWrittenWallTime: ISODate('2024-11-14T11:36:01.474Z'),
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
electionTime: Timestamp({ t: 1731575515, i: 1 }),
electionDate: ISODate('2024-11-14T09:11:55.000Z'),
configVersion: 10,
configTerm: 3,
self: true,
lastHeartbeatMessage: ''
},
{
_id: 1,
name: 'XXXXXXXXXXXXXXX:27017',
health: 1,
state: 0,
stateStr: 'STARTUP',
uptime: 1925,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
optimeWritten: { ts: Timestamp({ t: 0, i: 0 }), t: Long('-1') },
optimeDate: ISODate('1970-01-01T00:00:00.000Z'),
optimeDurableDate: ISODate('1970-01-01T00:00:00.000Z'),
optimeWrittenDate: ISODate('1970-01-01T00:00:00.000Z'),
lastAppliedWallTime: ISODate('1970-01-01T00:00:00.000Z'),
lastDurableWallTime: ISODate('1970-01-01T00:00:00.000Z'),
lastWrittenWallTime: ISODate('1970-01-01T00:00:00.000Z'),
lastHeartbeat: ISODate('2024-11-14T11:36:00.038Z'),
lastHeartbeatRecv: ISODate('1970-01-01T00:00:00.000Z'),
pingMs: Long('9'),
lastHeartbeatMessage: '',
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: -2,
configTerm: -1
}
],
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1731584161, i: 5 }),
signature: {
hash: Binary.createFromBase64('XXXXXXXXXX', 0),
keyId: Long('XXXXXXXXXXXX')
}
},
operationTime: Timestamp({ t: 1731584161, i: 5 })
}
rs.config() no Secundário
MongoServerError[NotYetInitialized]: no replset config has been received