Did anyone successfully set up ECS using distributed Elixir? I am tackling this right now.
I am especially interested how to connect the nodes. I was thinking it might make sense to write a custom libcluster strategy that fetches the current ip’s connected to the Application Load Balancer. ECS also offers service discovery using DNS, so that might also be a solution (this creates an A record for each node) and there seems to be a DNS strategy already in libcluster.
As far as I know these are the things to be addressed:
- Setting the node name to:
- Exposing the Port Mapper Daemon port in the VPC and docker image (4369)
- Exposing the intra-erlang communication ports (configurable using inet_dist_listen_min, inet_dist_listen_max) in the VPC and the docker image
- Service discovery (setting up communication between nodes) using a libcluster strategy
Setting the hostname to include the private IP can be done by using
curl http://169.254.169.254/latest/meta-data/local-ipv4, not sure yet how to best inject this as a env variable.
Perhaps anyone already has figured some of this out on ECS/EC2? Help really appreciated! Planning to document the results so it’s easier for other to get this up and running. I already have some experience building a very small docker image using releases and multi-stage builds.