[erlang-questions] Starting Erlang distribution programmatically

Ajit Yagaty ajityagaty@REDACTED
Sat Dec 8 01:17:52 CET 2018


Hello All,

Currently, one can start an Erlang node in distributed mode by passing in
the “proto_dist” parameter on the command line. Could anyone please let me
know if there is a way to start the distribution on a non-distributed
Erlang node (in any one of inet_tcp/inet6_tcp/inet_tls/inet6_tls modes)
programmatically?


In the code (
https://github.com/erlang/otp/blob/master/lib/kernel/src/net_kernel.erl#L1487),
there seems to be a reliance on the presence of the command line argument
“proto_dist”. If not passed, proto_dist always defaults to inet_tcp.


If there is a way to start the distribution programmatically, then the
logic that decides what proto_dist value to pass can be moved from the init
script (when the application is run as a service) into an Erlang module.
This would also help in not having to re-write this code snippet for all
the different platforms (Linux/Windows/OSX) that one would want to support.


Any tips on this will be very helpful.


But if there is no support to start the distribution programmatically, then
would it make sense to add that support?


Best regards,

Ajit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181207/842ce4d1/attachment.htm>


More information about the erlang-questions mailing list