我在三台不同的机器上设置了一个mongo replicaSet。当我运行rs.status()时,我收到以下内容:
{
"set" : "rep0",
"date" : ISODate("2014-01-23T16:21:31Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "frankenstein.chocolate.worker.0:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 589,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"self" : true
},
{
"_id" : 1,
"name" : "frankenstein_worker_1:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 586,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"lastHeartbeat" : ISODate("2014-01-23T16:21:29Z"),
"lastHeartbeatRecv" : ISODate("2014-01-23T16:21:31Z"),
"pingMs" : 5,
"syncingTo" : "frankenstein_worker_2:27017"
},
{
"_id" : 2,
"name" : "frankenstein_worker_2:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 584,
"optime" : Timestamp(1390490895, 11),
"optimeDate" : ISODate("2014-01-23T15:28:15Z"),
"lastHeartbeat" : ISODate("2014-01-23T16:21:31Z"),
"lastHeartbeatRecv" : ISODate("2014-01-23T16:21:30Z"),
"pingMs" : 5,
"syncingTo" : "frankenstein.chocolate.worker.0:27017"
}
],
"ok" : 1
}
一切似乎都运行良好,所有机器都是最新的。然而,当我查看oplog时,每分钟都会发生一个辅助计算机的相同查询。以下是这些查询的一个示例:
{
"opid" : 5315,
"active" : true,
"secs_running" : 1770,
"op" : "query",
"ns" : "local.oplog.rs",
"query" : {
"$query" : {
"$and" : [
{
"$or" : [
{
"ns" : "callcenter_analysis_db.documents"
},
{
"ns" : "callcenter_analysis_db.$cmd"
}
]
},
{
"ts" : {
"$gt" : Timestamp(1390112416, 15)
}
}
]
},
"$orderby" : {
"$natural" : 1
}
},
"client" : "xxx.xxx.xx.157:58079",
"desc" : "conn174",
"threadId" : "0x7f460f4db700",
"connectionId" : 174,
"locks" : {
"^" : "r",
"^local" : "R"
},
每个查询都完全相同,包括时间戳(secs_running的周期为60)。此查询仅来自客户端“xxx.xxx.xx.157”。由于此查询多次出现,mongo实际上正在使机器陷入困境。
其他一些有用的信息:
rep0:PRIMARY> db.printSlaveReplicationInfo()
source: frankenstein_worker_1:27017
syncedTo: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
= 6449 secs ago (1.79hrs)
source: frankenstein_worker_2:27017
syncedTo: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
= 6450 secs ago (1.79hrs)
rep0:PRIMARY> db.printReplicationInfo()
configured oplog size: 12572.1033203125MB
log length start to end: 721324secs (200.37hrs)
oplog first event time: Wed Jan 15 2014 01:06:11 GMT-0600 (CST)
oplog last event time: Thu Jan 23 2014 09:28:15 GMT-0600 (CST)
now: Thu Jan 23 2014 11:17:42 GMT-0600 (CST)
欣赏任何帮助或线索。谢谢!