[erlang-questions] Detect the Erlang cluster connection (ssl/tcp).

Gabriele Santomaggio g.santomaggio@REDACTED
Thu Feb 14 13:02:56 CET 2019


I am looking an easy way to detect the cluster connection (ssl/tcp).

Someone suggested using  net_kernel:nodes_info().  but not totally sure,
because of:
 - nodes_info is undocumented (http://erlang.org/doc/man/net_kernel.html)
so I suppose that should not be used.
- mostly works, but in servers, with multiple network interfaces I can have
an output like this:

$  sudo rabbitmqctl eval "net_kernel:nodes_info()."
{ok,[{'rabbit@REDACTED',
         [{owner,<11202.610.0>},
          {state,up},
          {address,
              {net_address,
                  {{127,0,0,1},52568},
                  "yyyyyyy",proxy,inet}},
          {type,normal},
          {in,5160486},
          {out,3360784}]},
     {'rabbit@REDACTED,
         [{owner,<11202.402.0>},
          {state,up},
          {address,
              {net_address,
                  {{127,0,0,1},52568},
                  "yyyyyyyyyyyy",proxy,inet}},
          {type,normal},
          {in,2956758},
          {out,5019215}]},


so "proxy" "inet" as family address and it is not clear what kind on the
cluster connection is.

In this case, for example, is a ssl cluster

 sudo rabbitmqctl eval "init:get_arguments()."
...
{pa,["$ERL_SSL_PATH"]},
 {proto_dist,["inet_tls"]},


Is there another way? should I call init:get_arguments() for each node?
Thank you


-- 
Gabriele Santomaggio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190214/a13543a0/attachment.htm>


More information about the erlang-questions mailing list