Connecting to remote production node is very useful to debug or observe production.
- target node
$ elixir --name [your application name]@[your host] --cookie 123 --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_m 9001" -S mix phoenix.server
- local node
$ iex --name debug@127.0.0.1 --cookie 123 --remsh [your application name]@[your host]
Sometimes, you should set port forwarding up to connect to target node via a particular node.