首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticBeanstalk中码头中的Akka集群

ElasticBeanstalk中码头中的Akka集群
EN

Stack Overflow用户
提问于 2017-08-24 00:51:27
回答 1查看 377关注 0票数 1

我正试图在码头,在ElasticBeanstalk中建立一个Akka集群。节点必须彼此通信,如下所示:

代码语言:javascript
复制
+-------------------------------------------------------+
| ElasticBeanstalk/ECS                                  |
|                                                       |
| +----------------------+     +----------------------+ |
| |  EC2                 |     |  EC2                 | |
| |                      |     |                      | |
| | +------------------+ |     | +------------------+ | |
| | |  Docker          | |     | |  Docker          | | |
| | |                  | |     | |                  | | |
| | |  +------------+  | |     | |  +------------+  | | |
| | |  |            |  | |     | |  |            |  | | |
| | |  |            +---------->->-->            |  | | |
| | |  |  Akka      |  | |     | |  |  Akka      |  | | |
| | |  |            <--<-<----------+            |  | | |
| | |  |            |  | |     | |  |            |  | | |
| | |  +------------+  | |     | |  +------------+  | | |
| | +------------------+ |     | +------------------+ | |
| +----------------------+     +----------------------+ |
+-------------------------------------------------------+

使用博客文章中的信息-- Akka集群EC2自动标度 (不包括Docker)和码头中的Akka集群 (不包括EC2) --我已经收集了一个几乎没有的解决方案。

最后一个障碍是节点之间的通信。每个节点正确识别另一个节点的内部IP。我假设EC2实例可以直接通信,绕过ECS负载均衡器。

akka节点正在监听端口2551。

代码语言:javascript
复制
/app # netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 :::sunproxyadmin        :::*                    LISTEN
tcp        0      0 d0a81ebbe72a:2551       :::*                    LISTEN

码头实例正在公开端口2551。

代码语言:javascript
复制
# docker ps
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS                    NAMES
d0a81ebbe72a        mystuff/potter:v1.0.7-cluster04       "sh -c 'java -jar -Xm"   About an hour ago   Up About an hour    0.0.0.0:2551->2551/tcp   ecs-awseb-maptiles-dev-uicd96apyp-6-potter-b8d6a7aef2c4c9c0a001
d6bc31f1798b        amazon/amazon-ecs-agent:latest        "/agent"                 About an hour ago   Up About an hour                             ecs-agent

EC2实例有一个安全组,它允许端口2551上的传入连接。

代码语言:javascript
复制
良 aws ec2 describe-instances --instance-ids "i-0750627a98ba930d4" "i-0bcd64a4121165327"|jq '.Reservations[].Instances[].SecurityGroups[]'
{
  "GroupName": "akka-remoting",
  "GroupId": "sg-6c267e16"
}
{
  "GroupName": "akka-remoting",
  "GroupId": "sg-6c267e16"
}

良 aws ec2 describe-security-groups --group-names akka-remoting | jq -c '.SecurityGroups[].IpPermissions'
[{"PrefixListIds":[],"FromPort":2551,"IpRanges":[{"CidrIp":"0.0.0.0/0"}],"ToPort":2551,"IpProtocol":"tcp","UserIdGroupPairs":[],"Ipv6Ranges":[{"CidrIpv6":"::/0"}]}]

良 aws ec2 describe-security-groups --group-names akka-remoting | jq -c '.SecurityGroups[].IpPermissionsEgress'
[{"PrefixListIds":[],"FromPort":2551,"IpRanges":[{"CidrIp":"0.0.0.0/0"}],"ToPort":2551,"IpProtocol":"tcp","UserIdGroupPairs":[],"Ipv6Ranges":[{"CidrIpv6":"::/0"}]}]

但是节点仍然不能看到对方。

代码语言:javascript
复制
[INFO] [08/23/2017 23:31:37.227] [main] [akka.remote.Remoting] Starting remoting
[INFO] [08/23/2017 23:31:37.805] [main] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://potter@172.31.12.161:2551]
[INFO] [08/23/2017 23:31:37.818] [main] [akka.cluster.Cluster(akka://potter)] Cluster Node [akka.tcp://potter@172.31.12.161:2551] - Starting up...
[INFO] [08/23/2017 23:31:37.867] [main] [akka.cluster.Cluster(akka://potter)] Cluster Node [akka.tcp://potter@172.31.12.161:2551] - Registered cluster JMX MBean [akka:type=Cluster]
[INFO] [08/23/2017 23:31:37.867] [main] [akka.cluster.Cluster(akka://potter)] Cluster Node [akka.tcp://potter@172.31.12.161:2551] - Started up successfully
[WARN] [08/23/2017 23:31:38.053] [New I/O boss #3] [NettyTransport(akka://potter)] Remote connection to [null] failed with java.net.ConnectException: Connection refused: /172.31.35.149:2551
[WARN] [08/23/2017 23:31:38.056] [potter-akka.remote.default-remote-dispatcher-7] [akka.tcp://potter@172.31.12.161:2551/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fpotter%40172.31.35.149%3A2551-0] Association with remote system [akka.tcp://potter@172.31.35.149:2551] has failed, address is now gated for [5000] ms. Reason: [Association failed with [akka.tcp://potter@172.31.35.149:2551]] Caused by: [Connection refused: /172.31.35.149:2551]

我错过了什么/误解了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-24 01:32:40

按照AWS论坛发布的多个开放港口的单码头集装箱中的建议,将Akka的akka.remote.netty.tcp.bind-hostname设置为0.0.0.0,而不是本地IP启用的通信。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45851301

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档