Hello, community!
We are making distributed nodes of elixir application at EC2.
Reading running node names and connect them all together done via hex package https://github.com/kyleaa/libcluster_ec2.
The only work we have to do is to start a named
server in the release and set cookie.
We update file rel/env.sh.eex and put set global variables there, such as:
IP=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE=<%= @release.name %>@IP
Finally our question:
- Is it proper way to get an IP of running instance?
- After we start
named
server node (via ./prod/rel/app/bin/app start) we lost opportunity to connect to it via prod/rel/app/bin/app remote. An error isCould not contact remote node app@IP, reason: :nodedown. Aborting...
We definitely doing something wrong, any advise appreciated )