【发布时间】:2017-06-17 04:12:03
【问题描述】:
我有副本集(托管在亚马逊上),其中有:
- 主要的
- 次要
- 仲裁者
它们都是 3.2.9 版本,这个副本正在我的分片集群中制作一个分片(如果这很重要,尽管我认为它不重要)。
当我在primary 上输入rs.status() 时,它说无法到达secondary,secondary 无法到达arbiter 并且arbiter 无法到达primary:
在主要:
{
"set" : "rs0",
"date" : ISODate("2017-06-16T18:43:23.992Z"),
"myState" : 1,
"term" : NumberLong(-1),
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
{
"_id" : 3,
"name" : "secondaryIP:27017",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" : Timestamp(0, 0),
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2017-06-16T18:43:22.767Z"),
"lastHeartbeatRecv" : ISODate("2017-06-16T18:43:22.931Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "Couldn't get a connection within the time limit",
"configVersion" : -1
},
在中学:
{"set" : "rs0",
"date" : ISODate("2017-06-16T19:08:23.364Z"),
"myState" : 2,
"term" : NumberLong(-1),
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
{
"_id" : 2,
"name" : "ip-x-x-x-x:27017",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"lastHeartbeat" : ISODate("2017-06-16T19:08:21.404Z"),
"lastHeartbeatRecv" : ISODate("2017-06-16T19:08:21.424Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "Couldn't get a connection within the time limit",
"configVersion" : -1
}
关于仲裁者:
{"set" : "rs0",
"date" : ISODate("2017-06-16T17:54:22.552Z"),
"myState" : 7,
"term" : NumberLong(-1),
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
{
"_id" : 4,
"name" : "primaryIP:27017",
"health" : 0,
"state" : 8,
"stateStr" : "(not reachable/healthy)",
"uptime" : 0,
"optime" : Timestamp(0, 0),
"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
"lastHeartbeat" : ISODate("2017-06-16T17:54:13.027Z"),
"lastHeartbeatRecv" : ISODate("2017-06-16T17:54:22.107Z"),
"pingMs" : NumberLong(0),
"lastHeartbeatMessage" : "Couldn't get a connection within the time limit",
"configVersion" : -1
}
从主要的错误日志:
2017-06-16T18:40:25.030+0000 I NETWORK [initandlisten] connection accepted from appIP:60768 #256386 (23 connections now open)
2017-06-16T18:40:28.762+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Failed to connect to secondaryIP:27017 - ExceededTimeLimit: Operation timed out
2017-06-16T18:40:28.762+0000 I REPL [ReplicationExecutor] Error in heartbeat request to secondaryIP:27017; ExceededTimeLimit: Operation timed out
2017-06-16T18:40:28.762+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Connecting to secondaryIP:27017
2017-06-16T18:40:34.761+0000 I REPL [ReplicationExecutor] Error in heartbeat request to secondaryIP:27017; ExceededTimeLimit: Couldn't get a connection within the time limit
2017-06-16T18:40:46.761+0000 I REPL [ReplicationExecutor] Error in heartbeat request to secondaryIP:27017; ExceededTimeLimit: Couldn't get a connection within the time limit
2017-06-16T18:40:48.762+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Failed to connect to secondaryIP:27017 - ExceededTimeLimit: Operation timed out
2017-06-16T18:40:48.762+0000 I REPL [ReplicationExecutor] Error in heartbeat request to secondaryIP:27017; ExceededTimeLimit: Operation timed out
2017-06-16T18:40:48.762+0000 I ASIO [NetworkInterfaceASIO-Replication-0] Connecting to secondaryIP:27017
我无法使用mongo --host <IP> 连接到任何 IP,并且超时。
所有副本集都在同一个 EC2 安全组中。
这与this issue 非常相似,但我无法理解针对该问题给出的答案。
如果需要,我可以提供更多信息。
数据库仍然可以在应用程序中访问和响应,但数字和日志存在一些不一致,这可能是由于此连接错误造成的。
任何帮助将不胜感激。
【问题讨论】:
标签: mongodb amazon-web-services amazon-ec2 sharding replicaset