Akka Cluster in Docker in ElasticBeanstalk -




i trying set akka cluster in docker, in elasticbeanstalk. nodes must communicate each other so:

+-------------------------------------------------------+ | elasticbeanstalk/ecs                                  | |                                                       | | +----------------------+     +----------------------+ | | |  ec2                 |     |  ec2                 | | | |                      |     |                      | | | | +------------------+ |     | +------------------+ | | | | |  docker          | |     | |  docker          | | | | | |                  | |     | |                  | | | | | |  +------------+  | |     | |  +------------+  | | | | | |  |            |  | |     | |  |            |  | | | | | |  |            +---------->->-->            |  | | | | | |  |  akka      |  | |     | |  |  akka      |  | | | | | |  |            <--<-<----------+            |  | | | | | |  |            |  | |     | |  |            |  | | | | | |  +------------+  | |     | |  +------------+  | | | | | +------------------+ |     | +------------------+ | | | +----------------------+     +----------------------+ | +-------------------------------------------------------+ 

using information in blog posts akka cluster ec2 autoscaling (which doesn't include docker) , akka cluster in docker (which doesn't include ec2) i've put almost there solution.

the final hurdle comms between nodes. each node correctly identifies internal ip of other. assume ec2 instances can communicate directly, bypassing ecs load balancer.

the akka nodes listening on port 2551.

/app # netstat -a active internet connections (servers , established) proto recv-q send-q local address           foreign address         state tcp        0      0 :::sunproxyadmin        :::*                    listen tcp        0      0 d0a81ebbe72a:2551       :::*                    listen 

the docker instances exposing port 2551.

# docker ps container id        image                                 command                  created             status              ports                    names d0a81ebbe72a        mystuff/potter:v1.0.7-cluster04       "sh -c 'java -jar -xm"   hour ago   hour    0.0.0.0:2551->2551/tcp   ecs-awseb-maptiles-dev-uicd96apyp-6-potter-b8d6a7aef2c4c9c0a001 d6bc31f1798b        amazon/amazon-ecs-agent:latest        "/agent"                 hour ago   hour                             ecs-agent 

the ec2 instances have security group allows incoming connections on port 2551.

良 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"}]}] 

but still nodes cannot see each other.

[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 [warn] [08/23/2017 23:31:38.053] [new i/o boss #3] [nettytransport(akka://potter)] remote connection [null] failed 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 remote system [akka.tcp://potter@172.31.35.149:2551] has failed, address gated [5000] ms. reason: [association failed [akka.tcp://potter@172.31.35.149:2551]] caused by: [connection refused: /172.31.35.149:2551] 

what have missed/misunderstood?

as per advice in aws forum post single docker container multiple open ports, setting akka's akka.remote.netty.tcp.bind-hostname 0.0.0.0 instead of local ip enabled comms.





wiki

Comments

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

Asterisk AGI Python Script to Dialplan does not work -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -