Mongo主要显示在主要背后?

时间:2015-04-27 15:47:28

标签: mongodb

Mongo主要显示在主要背后?它随着时间的推移而增加。请提出建议?

monRepl:PRIMARY> rs.printSlaveReplicationInfo()
source: xxxxxx:27017
    syncedTo: Mon Apr 27 2015 10:39:02 GMT+0530 (IST)
    **25835 secs (7.18 hrs) behind the primary** 

monRepl:PRIMARY> rs.status();
{
    "set" : "monRepl",
    "date" : ISODate("2015-04-27T12:20:38Z"),
    "myState" : 1,
    "members" : [
        {
            "_id" : 3,
            "name" : "xxxxx:27017",
            "health" : 1,
            "state" : 2,
            "stateStr" : "SECONDARY",
            "uptime" : 329104,
            "optime" : Timestamp(1430111629, 90),
            "optimeDate" : ISODate("2015-04-27T05:13:49Z"),
            "lastHeartbeat" : ISODate("2015-04-27T12:20:36Z"),
            "lastHeartbeatRecv" : ISODate("2015-04-27T12:20:37Z"),
            "pingMs" : 0,
            "syncingTo" : "yyyyyy:27017"
        },
        {
            "_id" : 5,
            "name" : "xxxxxx:27017",
            "health" : 1,
            "state" : 7,
            "stateStr" : "ARBITER",
            "uptime" : 329104,
            "lastHeartbeat" : ISODate("2015-04-27T12:20:38Z"),
            "lastHeartbeatRecv" : ISODate("2015-04-27T12:20:37Z"),
            "pingMs" : 0
        },
        {
            "_id" : 6,
            "name" : "yyyyyyy:27017",
            "health" : 1,
            "state" : 1,
            "stateStr" : "PRIMARY",
            "uptime" : 579120,
            "optime" : Timestamp(1430137238, 300),
            "optimeDate" : ISODate("2015-04-27T12:20:38Z"),
            "electionTime" : Timestamp(1429808169, 7),
            "electionDate" : ISODate("2015-04-23T16:56:09Z"),
            "self" : true
        }
    ],
    "ok" : 1
}

1 个答案:

答案 0 :(得分:0)

它是小学后面的中学。您可以通过将主要(2015-04-27T12:20:38Z)的optimeDate与次要(2015-04-27T05:13:49Z)的optimeDate进行比较来判断。如您所见,差异大约是7.18小时。

对于为什么次要是远远落后于主要......好问题。有很多可能的原因。