Mongodb“;“网络接口超出时间限制”;复制集 解决了的:
这是一个版本特定的bug。更新到mongodb-org@4.0.5解决了问题,机器连接良好。我将把这个问题留给最终面临同样问题的人 原始问题: 我在一个由两个成员组成的副本集中有两台服务器 mx.aireclaim.com是主要的,vimax.aireclaim.com是次要的。在mx.aireclaim.com上重新启动后,我在辅助端面临连接问题。我已经检查了防火墙,可以从每台计算机到另一台计算机访问27017端口 我在第二次考试中不断遇到此错误:Mongodb“;“网络接口超出时间限制”;复制集 解决了的:,mongodb,networking,replicaset,Mongodb,Networking,Replicaset,这是一个版本特定的bug。更新到mongodb-org@4.0.5解决了问题,机器连接良好。我将把这个问题留给最终面临同样问题的人 原始问题: 我在一个由两个成员组成的副本集中有两台服务器 mx.aireclaim.com是主要的,vimax.aireclaim.com是次要的。在mx.aireclaim.com上重新启动后,我在辅助端面临连接问题。我已经检查了防火墙,可以从每台计算机到另一台计算机访问27017端口 我在第二次考试中不断遇到此错误: Error in heartbeat (..
Error in heartbeat (...) response status: NetworkInterfaceExceededTimeLimit:
Couldn't get a connection within the time limit
我有什么东西不见了吗?我尝试在两台机器上同步日期,禁用防火墙,多次重新启动和配置更改,但都没有成功
以下是replicaset配置和rs.status()
主要的,重要的
次要的
以下是日志中发生的情况:
主要的,重要的
次要的
因此,看起来主节点接受连接,然后结束连接
您可能会认为这两台机器之间存在某种连接问题,但我可以:
aireclaim@aireclaim-platform-server:~> mongo mx.aireclaim.com
MongoDB shell version v3.6.10
connecting to: mongodb://mx.aireclaim.com:27017/test?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("de193403-69ca-4f74-a6c5-ee384eb420d7") }
MongoDB server version: 3.6.3
aireclaimRs:PRIMARY>
以及:
我还可以测试两台机器的端口27017是否打开,并且它们是否配置为在这些IP上运行
事实上,整个过程在某种程度上仍然是功能性的。尝试连接到复制集的客户机成功地实现了这一点,但看起来辅助服务器似乎不再进行复制
任何洞察都是天赐良机。将mongodb版本更新到4.0.5解决了这个问题我也面临同样的问题。我的mongo实例在3.6.2版本上。我们是否还需要更改连接池的大小?当我们收到此错误时:心跳信号中出现错误(…)响应状态:NetworkInterfaceeExceededTimeLimit:无法在时间限制内获得连接此错误的含义是什么?
aireclaimRs:SECONDARY> rs.status()
{
"set" : "aireclaimRs",
"date" : ISODate("2020-03-23T19:56:37.132Z"),
"myState" : 2,
"term" : NumberLong(20),
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
"lastCommittedOpTime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"appliedOpTime" : {
"ts" : Timestamp(1584838063, 1),
"t" : NumberLong(11)
},
"durableOpTime" : {
"ts" : Timestamp(1584838063, 1),
"t" : NumberLong(11)
}
},
"members" : [
{
"_id" : 0,
"name" : "vimax.aireclaim.com:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 890,
"optime" : {
"ts" : Timestamp(1584838063, 1),
"t" : NumberLong(11)
},
"optimeDate" : ISODate("2020-03-22T00:47:43Z"),
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"configVersion" : 3,
"self" : true,
"lastHeartbeatMessage" : ""
},
{
"_id" : 1,
"name" : "mx.aireclaim.com:27017",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"optimeDurable" : {
"ts" : Timestamp(0, 0),
"t" : NumberLong(-1)
},
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2020-03-23T19:56:31.106Z"),
"lastHeartbeatRecv" : ISODate("2020-03-23T19:56:36.034Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "Couldn't get a connection within the time limit",
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"infoMessage" : "",
"configVersion" : -1
}
],
"ok" : 1,
"operationTime" : Timestamp(1584838063, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1584993390, 1),
"signature" : {
"hash" : BinData(0,"zINnjtBKXZ14gJrxrUbT2zyurqQ="),
"keyId" : NumberLong("6765287379189104641")
}
}
}
tail /var/log/mongodb/mongodb.log
2020-03-23T21:08:09.420+0100 I NETWORK [conn2630] end connection 144.76.84.5:50114 (2 connections now open)
2020-03-23T21:08:29.420+0100 I NETWORK [listener] connection accepted from 144.76.84.5:50118 #2631 (3 connections now open)
2020-03-23T21:08:29.420+0100 I NETWORK [conn2631] end connection 144.76.84.5:50118 (2 connections now open)
2020-03-23T21:08:49.420+0100 I NETWORK [listener] connection accepted from 144.76.84.5:50122 #2632 (3 connections now open)
2020-03-23T21:08:49.420+0100 I NETWORK [conn2632] end connection 144.76.84.5:50122 (2 connections now open)
2020-03-23T21:09:09.421+0100 I NETWORK [listener] connection accepted from 144.76.84.5:50126 #2633 (3 connections now open)
2020-03-23T21:09:09.421+0100 I NETWORK [conn2633] end connection 144.76.84.5:50126 (2 connections now open)
2020-03-23T21:09:18.717+0100 I NETWORK [conn2629] end connection 127.0.0.1:60316 (1 connection now open)
2020-03-23T21:09:29.421+0100 I NETWORK [listener] connection accepted from 144.76.84.5:50130 #2634 (2 connections now open)
2020-03-23T21:09:29.421+0100 I NETWORK [conn2634] end connection 144.76.84.5:50130 (1 connection now open)
tail /var/log/mongodb/mongod.log
2020-03-23T20:48:13.408+0100 I REPL [replexec-1] Not starting an election, since we are not electable due to: Not standing for election because I cannot see a majority (mask 0x1)
2020-03-23T20:48:17.592+0100 I REPL_HB [replexec-1] Error in heartbeat (requestId: 74) to mx.aireclaim.com:27017, response status: NetworkInterfaceExceededTimeLimit: Couldn't get a connection within the time limit
2020-03-23T20:48:19.658+0100 I REPL [rsBackgroundSync] waiting for 2 pings from other members before syncing
2020-03-23T20:48:24.791+0100 I REPL [replexec-1] Not starting an election, since we are not electable due to: Not standing for election because I cannot see a majority (mask 0x1)
2020-03-23T20:48:28.092+0100 I REPL_HB [replexec-1] Error in heartbeat (requestId: 76) to mx.aireclaim.com:27017, response status: NetworkInterfaceExceededTimeLimit: Couldn't get a connection within the time limit
2020-03-23T20:48:29.593+0100 I ASIO [NetworkInterfaceASIO-Replication-0] Failed to connect to mx.aireclaim.com:27017 - NetworkInterfaceExceededTimeLimit: Operation timed out
2020-03-23T20:48:29.593+0100 I ASIO [NetworkInterfaceASIO-Replication-0] Connecting to mx.aireclaim.com:27017
2020-03-23T20:48:34.661+0100 I REPL [rsBackgroundSync] waiting for 2 pings from other members before syncing
2020-03-23T20:48:35.839+0100 I REPL [replexec-1] Not starting an election, since we are not electable due to: Not standing for election because I cannot see a majority (mask 0x1)
2020-03-23T20:48:38.593+0100 I REPL_HB [replexec-1] Error in heartbeat (requestId: 77) to mx.aireclaim.com:27017, response status: NetworkInterfaceExceededTimeLimit: Couldn't get a connection within the time limit
aireclaim@aireclaim-platform-server:~> mongo mx.aireclaim.com
MongoDB shell version v3.6.10
connecting to: mongodb://mx.aireclaim.com:27017/test?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("de193403-69ca-4f74-a6c5-ee384eb420d7") }
MongoDB server version: 3.6.3
aireclaimRs:PRIMARY>
root@mx /home/aireclaim mongo vimax.aireclaim.com
MongoDB shell version v3.6.3
connecting to: mongodb://vimax.aireclaim.com:27017/test
MongoDB server version: 3.6.10
aireclaimRs:SECONDARY>