I had the exact same issue. I fixed it but then another problem occurred.
To fix, check
- You have the following in
env.sh[.eex]
. Note that using short names won’t work, or I couldn’t get it to work. Use long names.
export RELEASE_DISTRIBUTION=name
export RELEASE_NODE=<%= @release.name %>@127.0.0.1
-
Restrict the port used by node to a specified one, e.g. adding
-kernel inet_dist_listen_min 60606 inet_dist_listen_max 60606
toELIXIR_ERL_OPTIONS
inenv.sh[.eex]
. -
Forward ports like
ssh -L 4369:127.0.0.1:4369 -L 60606:127.0.0.1:60606 nodehost
. Note you shouldn’t haveepmd
running in your system, and you have to use the remote one. To make sure you are not runningepmd
locally, runepmd -kill
before opening ssh session. -
Start IEx shell like
iex --hidden --cookie 'yourcookie' --name local@127.0.0.1
Now when I run Node.connect :"distname@127.0.0.1"
I get true
and nodes connect. But when I do :observer.start
locally and select the remote node in Nodes menu, I get the following error:
16:22:06.248 [error] [node: :"distname@127.0.0.1", call: {:observer_backend, :sys_info, []}, reason: {:badrpc, {:EXIT, {:undef, [{:observer_backend, :sys_info, [], []}, {:rpc, :"-handle_call_call/6-fun-0-", 5, [file: 'rpc.erl', line: 197]}]}}}]
Then I found about :runtime_tools
which contains :observer_backend
. See Troubleshooting in http://blog.plataformatec.com.br/2016/05/tracing-and-observing-your-remote-node.
After this, it works like a charm!