Kernel parameters that use rebar3 in erlang do not take effect

73 Views Asked by At

This is the configure file

cat config/sys.config
[
 {kernel, [
         {inet_dist_listen_min, 25672},
         {inet_dist_listen_max, 25680},
         {net_ticktime, 360},
         {net_tickintensity, 10}
        ]}
].

run: rebar3 shell --sname apple

The environment variables have taken effect:

(apple@centos7-mq1)1> application:get_all_env(kernel).
[{net_ticktime,360},
.....
 {shell_history_drop,[]},
 {net_tickintensity,10},
 {logger_sasl_compatible,false},
 {shell_docs_ansi,auto},
 {inet_dist_listen_min,25672},
 {logger_level,notice},
 {prevent_overlapping_partitions,true},
 {inet_dist_listen_max,25680}]

But the listening port is still random and does not start at 25672(inet_dist_listen_min):

TCP *:42151 (LISTEN)

If start directly with the erl command, It don't have this problem, such as:

erl -sname pear@centos7-mq1 -kernel inet_dist_listen_min 33672 inet_dist_listen_max 33680 net_ticktime 360 net_tickintensity 10   
1

There are 1 best solutions below

0
tandathuynh148 On

It seems you did not specify config file. try

erl -config File.config

Check the arg here: https://www.erlang.org/doc/man/erl.html