epmd(1)
π epmd(1) β Erlang Port Mapper Daemon π
okay so bestie, gather round, because we're reading the Erlang Module Definition manual page for epmd, and honestly? she is the quiet backbone of your whole distributed Erlang situation. no cap. π«Ά let's get into it.
π NAME π
epmd β Erlang Port Mapper Daemon
πΈ DESCRIPTION πΈ
So first things first, the epmd command can be used to start the port mapper daemon:
epmd [-d|-debug] [DbgExtra...] [-address Addresses]
[-port No] [-daemon] [-relaxed_command_check]
And it can also be used to talk to a port mapper daemon that's already running:
epmd [-d|-debug] [-port No] [-names|-kill|-stop Name]
(this daemon acts as a name server on all hosts involved in distributed Erlang computations.)
Here's the lore: when an Erlang node starts, the node has a name, and it obtains an address from the host OS kernel. That name and that address get sent to the epmd daemon running on the local host. In a TCP/IP environment, the address is made up of the IP address plus a port number. The node name is an atom of the form Name@Node. So the whole job of the epmd daemon is keeping track of which node name listens on which address β like, epmd maps symbolic node names to machine addresses. iconic behaviour, truly. π
The TCP/IP epmd daemon only keeps track of the Name (first) part of an Erlang node name. The Host part (whatever comes after the @) is implicit in the node name where the epmd daemon was contacted, as is the IP address where the Erlang node can be reached. So consistent and correct TCP naming services are therefore required for an Erlang network to function correctly. she's giving infrastructure diva. β¨
NOTE: On Windows the maximum number of nodes allowed in one epmd instance is 60. This is because of limitations in the current implementation. If you need more nodes, you should look into using and erlang based epmd implementation such as Erlang EPMD. π
π Starting the port mapper daemon π
The daemon is started automatically by command erl(1) if the node is to be distributed and no running instance is present. If it gets automatically launched, environment variables must be used to change the behavior of the daemon; see section Environment Variables.
If argument -daemon is not specified, epmd runs as a normal program with the controlling terminal of the shell in which it is started. Normally, it is to be run as a daemon.
Regular startup options are described in section Regular Options.
The DbgExtra options are described in section DbgExtra Options.
π¦ Communicating with a running port mapper daemon π¦
Communicating with the running epmd daemon by the epmd program is done primarily for debugging purposes. (yes, she's nosey. it's fine.)
The different queries are described in section Interactive options.
π Regular Options π
These options are available when starting the name server. The name server is normally started automatically by command erl(1) (if not already available), but it can also be started at system startup. lowkey flexible of her. π
-address Listβ Lets this instance ofepmdlisten only on the comma-separated list of IP addresses and on the loopback address (which is implicitly added to the list if it has not been specified). This can also be set using environment variableERL_EPMD_ADDRESS; see section Environment Variables.-port Noβ Lets this instance ofepmdlisten to another TCP port than default4369. This can also be set using environment variableERL_EPMD_PORT; see section Environment Variables.-d|-debugβ Enables debug output. The more-dflags specified, the more debug output you will get (to a certain limit). This option is most useful when theepmddaemon is not started as a daemon.-daemonβ Startsepmddetached from the controlling terminal. Logging ends up in syslog when available and correctly configured. If theepmddaemon is started at boot, this option is definitely to be used. It is also used when commanderlautomatically startsepmd.-relaxed_command_checkβ Starts theepmdprogram with relaxed command checking (mostly for backward compatibility). This affects the following:- With relaxed command checking, the
epmddaemon can be killed from the local host with, for example, commandepmd -killeven if active nodes are registered. Normally only daemons with an empty node database can be killed withepmd -kill. - Command
epmd -stop(and the corresponding messages toepmd, as can be specified usingerl_interface:ei(3)) is normally always ignored. This because it can cause a strange situation where two nodes of the same name can be alive at the same time. A node unregisters itself by only closing the connection toepmd, which is why command stop was only intended for use in debugging situations.
- With relaxed command checking, the
With relaxed command checking enabled, you can forcibly unregister live nodes.
Relaxed command checking can also be enabled by setting environment variable ERL_EPMD_RELAXED_COMMAND_CHECK before starting epmd.
Use relaxed command checking only on systems with very limited interactive usage. fr fr, don't be reckless with her. π
π§ DbgExtra Options π§
NOTE: These options are only for debugging and testing epmd clients. They are not to be used in normal operation. π
-packet_timeout Secondsβ Sets the number of seconds a connection can be inactive beforeepmdtimes out and closes the connection. Defaults to60.-delay_accept Secondsβ To simulate a busy server, you can insert a delay between whenepmdgets notified that a new connection is requested and when the connection gets accepted.-delay_write Secondsβ Also a simulation of a busy server. Inserts a delay before a reply is sent.
π Interactive Options π
These options make epmd run as an interactive command, displaying the results of sending queries to an already running instance of epmd. The epmd contacted is always on the local node, but option -port can be used to select between instances if several are running using different ports on the host. main character energy, honestly. π
-port Noβ Contacts theepmdlistening on the specified TCP port number (default4369). This can also be set using environment variableERL_EPMD_PORT; see section Environment Variables.-namesβ Lists names registered with the currently runningepmd.-killβ Kills the currently runningepmd.
Killing the running epmd is only allowed if epmd -names shows an empty database or if -relaxed_command_check was specified when the running instance of epmd was started.
Notice that -relaxed_command_check is specified when starting the daemon that is to accept killing when it has live nodes registered. When running epmd interactively, -relaxed_command_check has no effect. A daemon that is started without relaxed command checking must be killed using, for example, signals or some other OS-specific method if it has active clients registered.
-stop Nameβ Forcibly unregisters a live node from theepmddatabase.
This command can only be used when contacting epmd instances started with flag -relaxed_command_check.
Notice that relaxed command checking must enabled for the epmd daemon contacted. When running epmd interactively, -relaxed_command_check has no effect.
π Environment Variables π
ERL_EPMD_ADDRESSβ Can be set to a comma-separated list of IP addresses, in which case theepmddaemon will listen only on the specified address(es) and on the loopback address (which is implicitly added to the list if it has not been specified). The default behavior is to listen on all available IP addresses.ERL_EPMD_PORTβ Can contain the port numberepmdwill use. The default port will work fine in most cases. A different port can be specified to allow several instances ofepmd, representing independent clusters of nodes, to co-exist on the same host. All nodes in a cluster must use the sameepmdport number.ERL_EPMD_RELAXED_COMMAND_CHECKβ If set before start, theepmddaemon behaves as if option-relaxed_command_checkwas specified at startup. Consequently, if this option is set before starting the Erlang virtual machine, the automatically startedepmdaccepts the-killand-stopcommands without restrictions.
β Logging β
On some operating systems syslog will be used for error reporting when epmd runs as a daemon. To enable the error logging, you must edit the /etc/syslog.conf file and add an entry:
!epmd
*.*<TABs>/var/log/epmd.log
where <TABs> are at least one real tab character. Spaces are silently ignored. (so don't be out here using your spacebar, bestie, she will NOT read it. π)
π Access Restrictions π
The epmd daemon accepts messages from both the local host and remote hosts. However, only the query commands are answered (and acted upon) if the query comes from a remote host. It is always an error to try to register a node name if the client is not a process on the same host as the epmd instance is running on. Such requests are considered hostile and the connection is closed immediately. periodt. π₯
The following queries are accepted from remote nodes:
- Port queries, that is, on which port the node with a specified name listens
- Name listing, that is, gives a list of all names registered on the host
To restrict access further, firewall software must be used.
πΈ and that's the whole vibe check, bestie β this page comes to you from Ericsson AB, tracking erts 17.0.6, and it's epmd(1) all the way down. go map some ports, you absolute legend. πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: erlang-base 1:29.0.6+dfsg-1 Β· Apache-2.0
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms