应用程序在码头工人的EB运行死不连接到自 [英] App running in Docker on EB refuses connecting to self

查看:333
本文介绍了应用程序在码头工人的EB运行死不连接到自的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个播放2 web应用程序,这是我部署到弹性青苗使用泊坞窗。在这个web应用程序,我开始了阿卡集群。启动过程包括将所有节点上的自动缩放组作为种子节点(包括自己)研究。在第一次部署到EB我指定要部署到VPC(我只能选择一个可用区)。

I have a Play 2 web application, which I deploy to Elastic Beanstalk using Docker. In this web app, I start an Akka cluster. The starting procedure involves adding all nodes in the autoscaling group as seed nodes (including itself). On the first deploy to EB I specify to deploy to a VPC (I only select one availability zone).

当我运行的应用程序,并启动群集,我得到以下信息:

When I run the app and start the cluster, I get the following message:

AssociationError [akka.tcp://集群@本地:2551] - > [akka.tcp://cluster@172.31.13.25:2551]:错误[无效地址:akka.tcp://cluster@172.31。 13.25:2551] [   akka.remote.InvalidAssociation:无效地址:akka.tcp://cluster@172.31.13.25:2551   致:akka.remote.transport.Transport $ InvalidAssociationException:连接被拒绝:/172.31.13.25:255​​1

AssociationError [akka.tcp://cluster@localhost:2551] -> [akka.tcp://cluster@172.31.13.25:2551]: Error [Invalid address: akka.tcp://cluster@172.31.13.25:2551] [ akka.remote.InvalidAssociation: Invalid address: akka.tcp://cluster@172.31.13.25:2551 Caused by: akka.remote.transport.Transport$InvalidAssociationException: Connection refused: /172.31.13.25:2551

其中172.31.13.25是EC2实例的IP,并且2551是端口。 在我Dockerfile我有揭发9000 2551。在EC2安全组我已启用所有入站流量
0.0.0.0/0(和所有出站流量)。在VPC网络访问控制列表(及安全组),我还开了所有流量。

Where 172.31.13.25 is the IP of the EC2 instance, and 2551 is the port. In my Dockerfile I have "EXPOSE 9000 2551". In the EC2 Security Group I have enabled all inbound traffic to
0.0.0.0/0 (and all outbound traffic). In the VPC Network ACLs (and security groups) I've also opened for all traffic.

这是我的Dockerfile

This is my Dockerfile

FROM dockerfile/java:latest
MAINTAINER a <a@b.de>
EXPOSE 9000 2551
ADD files /
WORKDIR /opt/docker
RUN ["chown", "-R", "daemon", "."]
USER daemon
ENTRYPOINT ["bin/myapp"]
CMD []

为什么我的EC2实例拒绝连接到自己的端口2551?

Why does my EC2 instance refuse a connection to itself on port 2551?

推荐答案

事实证明,这是不可能的,因为现在使用的码头工人弹性魔豆。 然而,有可能使用Tomcat。

Turns out this is not possible as of now using Docker on Elastic Beanstalk. It is, however, possible using Tomcat.

使用播放/激活,您可以部署一个WAR文件。通过注入以下.ebextensions配置文件到war文件,我是能够得到一个额外的端口EC2实例之间的公开:

Using play/activator, you can deploy a WAR file. By injecting the following .ebextensions config file into the war file, I was able to get an extra port open between the EC2 instances:

Resources:
  ExtraPortsSGIngress:
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      GroupId: { "Ref" : "AWSEBSecurityGroup" }
      IpProtocol: "tcp"
      FromPort: "2551"
      ToPort: "2551"
      SourceSecurityGroupId: { "Ref" : "AWSEBSecurityGroup" }

这篇关于应用程序在码头工人的EB运行死不连接到自的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆