Reputation: 181
I'm fairly new with mongodb
I have a replica set 3 nodes 1 primary (A) 1 secondary (B) 1 Arbiter (C)
The replica set was created using MMS the 3 node are in 3 different cities
I keep on getting the following error on the secondary that last for lest then a second each time
if not any idea how to correct it
{
"_id" : 1,
"name" : "B:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 1213371,
"optime" : Timestamp(1434051221, 1),
"optimeDate" : ISODate("2015-06-11T19:33:41Z"),
"infoMessage" : **"could not find member to sync from"**,
"configVersion" : 4,
"self" : true
},
Thank you
Regards
Philippe Courtois
Upvotes: 11
Views: 18250
Reputation: 2685
This is what worked for me:
Execute rs.syncFrom
command from secondary with primary host as an argument. In my case, open5gs-mongodb-0.mongodb-svc:27017
is primary and open5gs-mongodb-1.mongodb-svc:27017
is secondary. So, I executed following command from the mongod shell running on secondary replica (open5gs-mongodb-1.mongodb-svc:27017
):
rs0:SECONDARY> rs.syncFrom("open5gs-mongodb-0.mongodb-svc:27017")
{
"syncFromRequested" : "open5gs-mongodb-0.mongodb-svc:27017",
"prevSyncTarget" : "open5gs-mongodb-0.mongodb-svc:27017",
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1642373299, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
},
"operationTime" : Timestamp(1642373299, 1)
}
Upvotes: 0
Reputation: 61
make sure the secondary has at minimum the same priority value as the primary or lower. in my case, i had the secondary priority value higher than the primary's priority
you can check this by running
mongodcluster:PRIMARY> rs.conf()
https://docs.mongodb.com/manual/tutorial/adjust-replica-set-member-priority/
Upvotes: 3
Reputation: 61
May your oplog is full. You can increase the oplog size.
Try do this
You can find more on: Change the Size of the Oplog
Upvotes: 1
Reputation: 2715
You need to make sure that A, B, C resolves on each of the nodes.
Add them in /etc/hosts
a x.x.x.x b x.x.x.x c x.x.x.x
and do this on every node, then restart mongod, this should fix it
Upvotes: 1