- The output of `db.printSecondaryReplicationInfo()
source: #71:27001
syncedTo: Fri Aug 06 2021 14:24:59 GMT+0900 (KST)
-10 secs (0 hrs) behind the primary
source: #71:27002
syncedTo: Fri Aug 06 2021 14:24:49 GMT+0900 (KST)
0 secs (0 hrs) behind the primary
- I don’t know what mean topology. so I show you some informations
MongoDB 4.2.15 enterprise edition
# mongod.conf
storage:
# engine: wiredTiger
dbPath: "/home/hskim/data"
# journal:
# enabled: true
engine: inMemory
inMemory:
engineConfig:
inMemorySizeGB: 2
systemLog:
destination: file
path: "/home/hskim/log/mongo.log"
logAppend: true
logRotate: reopen
net:
# bindIp: 0.0.0.0
bindIp: 127.0.0.1,#.71
port: 27000
maxIncomingConnections: 65535
.#setParameter:
.# flowControlTargetLagSeconds: 10
processManagement:
fork: true
pidFilePath: "/home/hskim/mongod.pid"
security:
authorization: enabled
keyFile: /home/hskim/mongod.key
replication:
replSetName: rs0
.# enableMajorityReadConcern: true
.# oplogSizeMB: 2048
>rs.status()
>{
"set" : "rs0",
"date" : ISODate("2021-08-06T05:27:11.165Z"),
"myState" : 2,
"term" : NumberLong(1),
"syncingTo" : "#71:27000",
"syncSourceHost" : "#71:27000",
"syncSourceId" : 0,
"heartbeatIntervalMillis" : NumberLong(2000),
"majorityVoteCount" : 2,
"writeMajorityCount" : 2,
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"lastCommittedWallTime" : ISODate("1970-01-01T00:00:00Z"),
"appliedOpTime" : {
"ts" : Timestamp(1628227629, 1),
"t" : NumberLong(1)
},
"durableOpTime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"lastAppliedWallTime" : ISODate("2021-08-06T05:27:09.277Z"),
"lastDurableWallTime" : ISODate("1970-01-01T00:00:00Z")
},
"lastStableRecoveryTimestamp" : Timestamp(0, 0),
"electionParticipantMetrics" : {
"votedForCandidate" : true,
"electionTerm" : NumberLong(1),
"lastVoteDate" : ISODate("2021-08-06T05:21:29.240Z"),
"electionCandidateMemberId" : 0,
"voteReason" : "",
"lastAppliedOpTimeAtElection" : {
"ts" : Timestamp(1628227278, 1),
"t" : NumberLong(-1)
},
"maxAppliedOpTimeInSet" : {
"ts" : Timestamp(1628227278, 1),
"t" : NumberLong(-1)
},
"priorityAtElection" : 1,
"newTermStartDate" : ISODate("2021-08-06T05:21:29.257Z"),
"newTermAppliedDate" : ISODate("2021-08-06T05:21:30.735Z")
},
"members" : [
{
"_id" : 0,
"name" : "#71:27000",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 351,
"optime" : {
"ts" : Timestamp(1628227629, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(1628227400, 4),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-08-06T05:27:09Z"),
"optimeDurableDate" : ISODate("2021-08-06T05:23:20Z"),
"lastHeartbeat" : ISODate("2021-08-06T05:27:10.882Z"),
"lastHeartbeatRecv" : ISODate("2021-08-06T05:27:09.425Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"electionTime" : Timestamp(1628227289, 1),
"electionDate" : ISODate("2021-08-06T05:21:29Z"),
"configVersion" : 1
},
{
"_id" : 1,
"name" : "#71:27001",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 469,
"optime" : {
"ts" : Timestamp(1628227629, 1),
"t" : NumberLong(1)
},
"optimeDate" : ISODate("2021-08-06T05:27:09Z"),
"syncingTo" : "#71:27000",
"syncSourceHost" : "#71:27000",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1,
"self" : true,
"lastHeartbeatMessage" : ""
},
{
"_id" : 2,
"name" : "#71:27002",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 351,
"optime" : {
"ts" : Timestamp(1628227629, 1),
"t" : NumberLong(1)
},
"optimeDurable" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"optimeDate" : ISODate("2021-08-06T05:27:09Z"),
"optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2021-08-06T05:27:10.888Z"),
"lastHeartbeatRecv" : ISODate("2021-08-06T05:27:10.887Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "",
"syncingTo" : "#71:27000",
"syncSourceHost" : "#71:27000",
"syncSourceId" : 0,
"infoMessage" : "",
"configVersion" : 1
}
],
"ok" : 1
}
- What write concern are you using ?
A. I use default write concern