patch: Allow the erlang nodename host part to differ from the hostname
Ulf Wiger
ulf.wiger@REDACTED
Fri May 7 17:50:28 CEST 2010
http://github.com/uwiger/otp/tree/epmd_fullnames
Allow the erlang nodename host part to differ from the hostname
This patch makes it possible (practical) to start erlang nodes
using e.g. -sname n@REDACTED or -name n@REDACTED where the
host/domain differs from that of the machine in question.
While this was possible before, there were some limitations that
made it impractical. The main problem was that nodes use only the
name part when talking to epmd. This made it impossible to run
different nodes with the same name part on the same machine.
(which invalidates one of the good reasons for doing this; a
practical way to name nodes in a cluster is to use the same name
part on all nodes - myproduct@REDACTED, myproduct@REDACTED, etc.)
It turns out that epmd does not need changing. Rather, the nodes
send the full node name rather than just the name part. This is
done only if the flag -epmd_fullnames true is used. This means
that by default, everything works as before.
To make it backwards compatible, a node using "fullname" mode,
trying to connect to another node, will first try asking epmd
with the full node name. If that fails, it will retry with only
the name part. This makes it possible for "fullname" nodes to
connect to "halfname" nodes (although not the other way around).
The kernel test suites have been run. They didn't succeed
completely, but the failures seemed related to hard-coded
hostnames that only exist in the Erlang/OTP environment.
erl_interface has not been touched. This should be fixed, but
is not required for the feature to be useful for those who do
not use erl_interface.
(Forgot to check for whitespace changes before committing - sorry.
There are two lines in there that seem to have shifted, but my
network is almost dead, so for now, I'll let it be.)
BR,
Ulf W
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
More information about the erlang-patches
mailing list