[erlang-questions] Distributed OTP app not working when node is "-hidden"
Ulf Wiger
ulf@REDACTED
Wed Sep 21 12:41:12 CEST 2016
When using hidden nodes, the basic distribution semantics will work, but
node discovery is disabled. I.e. the hidden node will not appear in the
nodes() list of other nodes.
This means that some applications that rely on nodes being visible will not
work. Global and mnesia, for example.
If all nodes are hidden, they will still have names, and can still connect
to each other, but will not appear in the connection list.
Example:
uwpro:otp uwiger$ erl -name a -hidden
Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:8:8] [async-threads:10]
[hipe] [kernel-poll:false]
Eshell V7.3.1 (abort with ^G)
(a@REDACTED)1>
uwpro:~ uwiger$ erl -name b -hidden
Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:8:8] [async-threads:10]
[hipe] [kernel-poll:false]
Eshell V7.3.1 (abort with ^G)
(b@REDACTED)1> net:ping('a@REDACTED').
pong
(b@REDACTED)2> nodes().
[]
(a@REDACTED)1> register(me, self()).
true
(b@REDACTED)3> {me, 'a@REDACTED'} ! hello.
hello
(b@REDACTED)4>
(a@REDACTED)2> flush().
Shell got hello
ok
(a@REDACTED)3>
You can write code that understands this, e.g. relying on some
configuration database, but many existing components are likely to expect
nodes to be visible.
BR,
Ulf W
2016-09-20 17:16 GMT+02:00 Frank Muller <frank.muller.erl@REDACTED>:
> Hi everyone
>
> I've a simple OTP-compliant release, and I want to make it distributed on
> two nodes.
>
> Following the steps here, it was pretty simple to achieve:
> http://erlang.org/doc/design_principles/distributed_applications.html
>
> as long as my application is not "hidden".
>
> My constraint is that I need to keep my node "hidden" because it
> connects to other critical nodes in our infrastructure.
>
> If I set "-hidden" in "vm.args", the distribution breaks and the two nodes
> (the master and the backup) become both active, which is not desired :-(
>
> Anyone knows how to benefit from the distribution feature while keeping my
> node "hidden"?
>
> Any other alternative(s) to solve my issue?
>
> Regards
> Frank
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160921/458fd4f0/attachment.htm>
More information about the erlang-questions
mailing list