assuming we define a full node name as
name@host, how does the EPMD compare two node names?
Does it take into account both parts i.e.
host or only
My current understanding is as follows. We have node A and we want to connect it to node B with name
- Node B registers itself in epmd as
- Node A asks
host_b:epmd_portfor port for
name_band saves it under
- Node A contacts
Because node B can listen to
0.0.0.0, there is no need to store
host_b in EPMD.
However, epmd docs says:
The name and address are sent to the epmd daemon running on the local host. In a TCP/IP
environment, the address consists of the IP address and a port number.
The node name is an atom on the form of Name@Node. The job of the epmd daemon is to keep track of which node name listens on which address.
Hence, epmd maps symbolic node names to machine addresses.
So not only do we store
host part of the node name (refered in docs as
Node) but also some ip address?
I am asking in the context of DNS. So we want to use DNS clustering strategy from
libcluster (see here) but they require our nodes to be named
So we assume that EPMD uses very strict name comparision i.e. when we ask EPMD for
host_b_port we pass it the whole node name so
host_b, in the case of DNS, has to be an IP address (not sure why it can’t be domain name?)
What I would like to achieve is something like this:
- Node B is started with
nameand some “arbitrary”
- Node A is started with the same
nameas Node B and some other, “arbitrary”
host_apart, sends a query to the DNS server, obtains Node B ip address and saves it under
- Node A connects to the node B using
- Contact Node B using
So we basically don’t need to use
host part of the node name.
The bigger context is that when I start my service via Docker, I don’t know yet its IP address i.e. I cannot pass it via environment variable to configure the distribution.