$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
On your machine, start a hidden Erlang node running the observer
app:
$ erl -name debug@127.0.0.1 -setcookie if-server-has-one -hidden -run observer
N.B.: If the server is using -sname
, you need to use -sname
as well, because Erlang™. You'll also need to change your system's hostname to match the target host, for the same reason.
In observer, go to Nodes - Connect Node and type some_node@127.0.0.1
.
You can also get a remote shell:
$ erl -name debug@127.0.0.1 -setcookie if-server-has-one -remsh some_node@127.0.0.1
FYI this will not work if your remote nodes are named in the format of:
-name some_name@10.10.10.10
-name some_name@example.com
If:
Rename to
-name some_name@127.0.0.1
, and this guide should work.This Stack Overflow answer explains why this is the case:
EDIT
If you have to have your remote node name in the format of
-name some_name@10.10.10.10
, in addition to the SSH port forward with-L
, you can either do:-R
iptables
orpf
rules to redirect traffic from your local machine to10.10.10.10:EPMD_PORT
and10.10.10.10:APP_PORT
back to localhost. Here's a helpful StackOverflow post.