在erlang中使用rebar 3的内核参数不会生效

9bfwbjaz  于 5个月前  发布在  Erlang
关注(0)|答案(1)|浏览(63)

配置文件

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

环境变量已生效:

(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}]

但是监听端口仍然是随机的,并且不是从25672开始(inet_dist_listen_min):

第一个月

如果直接用erl命令启动,就不会有这个问题,比如:

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

ecbunoof

ecbunoof1#

似乎你没有指定配置文件。试试
erl -config文件.config
在这里检查参数:https://www.erlang.org/doc/man/erl.html

相关问题