A remote shell is an interactive IEx session whose expressions execute on another running BEAM node. It turns a live system into an operational workspace without requiring the production process to run in the foreground. section 13.1.1 section 13.4
Use a remote shell to:
- Inspect runtime and process state with functions such as :erlang.system_info/1, :erlang.memory/0, Process.list/0, and Process.info/1. section 13.3.3
- Send messages, stop or restart processes and supervisors, stop OTP applications, or reload module code. section 13.3.3
- Connect to a detached node with iex --remsh, or attach to a release through its remote command. section 13.1.1 section 13.2.2
- Keep the production node running when the remote shell exits; stopping the node itself terminates its applications and BEAM instance. section 13.1.1 section 13.2.2
Attach to a running node
Start a hidden debugger node and use it as a shell for todo_system: `iex --sname debugger@localhost --remsh todo_system@localhost --hidden`. The prompt identifies the target node, and calls run there rather than on the debugger node. section 13.1.1
$ RELEASE_NODE="todo@localhost" _build/prod/rel/todo/bin/todo remote iex(todo@localhost)1>
A release exposes a direct remote-shell command, separating shell access from starting, stopping, and daemonizing the production system. section 13.2.2
