amazon-web-serviceselasticsearchamazon-elastic-beanstalk

Expose Docker port on Amazon Elastic Beanstalk


I'm trying to deploy an application which opens two ports; one is a simple HTTP server, another is used to communicate with other instances and join in clusters. It's Elasticsearch. Using Dockerfile and Dockerrun.aws.js or configuration files in distribution how is it possible to tell Elastic Beanstalk to map port 9300 to a private networking interface?

My Dockerfile has EXPOSE 9200 9300 but Elastic Beanstalk will only attach nginx reverse proxy to first port. Nothing is said about how to map other ports without nginx. Using .ebextensions it is possible to execute any shell command. I am trying to map the port via iptables. I was able to map ports to the host machine and setup Elasticsearch discovery. However, Elasticsearch still doesn't want to create a cluster:

disconnecting from [...] due to explicit disconnect call

Solution

  • I was not able to make ElasticSearch to discover other nodes on EBT Docker environment, however I made it work using instance itself

    Working config https://github.com/vladmiller/elasticsearch-beanstalk