In one of the Sharded replica set, 2 members are listed as primary and not able to connect via mongos. Is this an expected behavior?
That is definitely not expected behaviour.
Please provide some more information:
-
version of MongoDB server
-
output of
rs.status()
andrs.conf()
from each of the members that thinks it is primary with any identifying details (hostnames or IPs) replaced with anonymised equivalents
Thanks,
Stennie
Mongo Version: 4.4
Identified the member that did not sync and removed it from the replica set. Cleaned up the member and added it back.
“xxxw11.yyy.com:20019” & “xxxs10.yyy.com:27017” was showing as primary that caused this issue.
rs.conf()
{
"_id" : "EVENTSHARD3",
"version" : 16,
"protocolVersion" : NumberLong(1),
"writeConcernMajorityJournalDefault" : true,
"members" : [
{
"_id" : 0,
"host" : "xxxw10.yyy.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 2,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 3,
"host" : "xxxs10.yyy.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 4,
"host" : "xxxs11.yyy.com:27017",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 5,
"host" : "xxxe4.yyy..com:27017",
"arbiterOnly" : true,
"buildIndexes" : true,
"hidden" : false,
"priority" : 0,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
},
{
"_id" : 6,
"host" : "xxxw11.yyy.com:20019",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 2,
"tags" : {
},
"slaveDelay" : NumberLong(0),
"votes" : 1
}
],
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("6000e331c1ce8372fbc01e74")
}
}