3

I have a Play 2.3.6 application that I deploy using a WAR file to Tomcat running on Elastic Beanstalk. The app exposes port 80 for normal HTTP. The app also exposes another port (2551), which it uses to build an Akka cluster. When deployed to AWS, though, the app is refused to connect to port 2551 on even localhost. Is it possible to expose multiple ports through Tomcat on Elastic Beanstalk?

It should not be served through the servlet, rather it is a normal socket. And the akka port should not be exposed to the outside world (through the load balancer), just between EC2 instances.

DkM
  • 800
  • 1
  • 7
  • 22
  • I don't think you can expose multiple ports on Elastic Beanstalk but I couldn't find any official source to confirm it. People observing the same behavior with Docker on EB: http://stackoverflow.com/questions/27381651/app-running-in-docker-on-eb-refuses-connecting-to-self#comment43244565_27381651 – Céline Aussourd Dec 18 '14 at 11:23
  • Hi, just to expand a bit. I don't want the port exposed through the load balancer, rather between EC2 instances – DkM Dec 19 '14 at 08:05

1 Answers1

1

Did you try the "Worker" Environment tier?

Basically I would create a Web Server tier for the Application which needs to be exposed over http and a worker environment for doing any background jobs like Housekeeping, Synch.

Here are some AWS documents explaining the difference between the two: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.concepts.architecture.html http://aws.amazon.com/blogs/aws/background-task-handling-for-aws-elastic-beanstalk/

I had asked a similar question to AWS support a few weeks back to see if it was possible to run 2 apps within the same Beanstalk container:

http://xxx.elasticbeanstalk.com/mainapp/
http://xxx.elasticbeanstalk.com/secndaryapp/

Their recommendation was to run each app in its own container.

Update: I just noticed that you have asked a similar question here Can you check your route tables as well ? Maybe you need to attach a gateway to it (Internet or VPN)

Community
  • 1
  • 1
Dhananjay
  • 642
  • 6
  • 15
  • Hi, seems like route tables etc. are fine :( It will be very hard to split into multiple apps, but maybe there will be no other ways. – DkM Dec 23 '14 at 12:06