I’m using mix release to deploy an app two two servers and am trying to get them connected to each other. I’ve set the following environment variables on each server:
When I launch both servers and then type the following command from SERVER 1’s iex session:
Node.ping :"app_name@server2.domain.com"
I get :pang as a response, meaning the connection failed. Similarly, if I try:
Node.connect :"app_name@server2.domain.com"
I get false as a return value, which also means the connection failed.
I’m able to ping SERVER 2 from SERVER 1 in Bash, so I know the FQDN is getting resolved correctly, but the Elixir nodes don’t want to talk to each other. I’ve also made sure the environment variables are really set and show up correctly in the iex prompt (e.g., app_name@server2.domain.com).
EDIT: I forgot to mention this earlier, but I have port 4369 open on both machines.
I’m not using Docker or Kubernetes (and have no desire to).
Any ideas (or further information you need from me)?
Have you opened the firewalls? There’s a set of ports that need to be open. Note that node-to-node communication is plaintext by default and opens you up for RCE so I wouldn’t do it except via an SSH tunnel or VPN or other similar solution.
Since the servers are running mix release builds, Erlang isn’t installed on the servers and I don’t have access to the epmd command. I did open all ports between the two machines just to see if blocked ports is the issue but I am still having connection issues.
I was able to get this working. The problem was a setting in AWS. I wish I could tell everyone what it was, in case someone else has this issue, but the guy managing our AWS account won’t tell us what he changed.
If you run into this problem and you’ve configured your mix release deployments as described in my original post, your side of things is correct. The issue is with your network configuration.