I have a Play 2 web application that I am deploying to Elastic Beanstalk using Docker. In this web application, I am running an Akka cluster. The start-up procedure involves adding all nodes to the autoscale group as starting nodes (including themselves). When I deploy to EB for the first time, I specify to deploy to VPC (I select only one availability zone).
When I launch the application and start the cluster, I get the following message:
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 Called: akka.remote.transport.Transport $ InvalidAssociationException: Connection refused: /172.31.13.25: 2551
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 turned on all incoming traffic at 0.0.0.0/0 (and all outgoing traffic). In VPC ACLs (and security groups), I also opened up to all traffic.
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 []
Why does my EC2 instance refuse to connect to itself on port 2551?