Erlang / Erlang Advanced Interview questions
What is EPMD and what role does it play in distributed Erlang?
EPMD (Erlang Port Mapper Daemon) is a small, lightweight process that runs once per host and acts as a name-to-port lookup service for Erlang nodes on that machine. Each node, on startup, registers its name and the TCP port it's listening on with the local EPMD; other nodes trying to connect first ask EPMD "what port is node X on?" before opening the actual inter-node connection.
sequenceDiagram
participant NodeA
participant EPMD
participant NodeB
NodeB->>EPMD: register(nodeb, Port)
NodeA->>EPMD: lookup(nodeb)
EPMD-->>NodeA: Port
NodeA->>NodeB: connect on Port
EPMD itself carries no message traffic between nodes — it's purely a directory service, running on a well-known port (4369) so nodes only need to know a hostname, not a specific port, to find each other. Losing EPMD after nodes are already connected doesn't drop those connections; it only affects new nodes trying to discover an existing one.
More Related questions...