环境
- EMQX 版本:v4.4.19
- 操作系统版本:ubuntu server 22.04 for raspi
问题描述
启动emqx失败
按照以下步骤进行安装,没有改过配置文件
以下是4.4.19的日志信息
root@ubuntu:/sunyard/lab420/emqx/bin# emqx console
!!!
WARNING: Default (insecure) Erlang cookie is in use.
Please set node.cookie in /sunyard/lab420/emqx/etc/emqx.conf or override from environment variable EMQX_NODE_COOKIE
NOTE: Use the same config value for all nodes in the cluster.
!!!
Erlang/OTP 24 [erts-12.3.2.2] [emqx] [64-bit] [smp:4:4] [ds:4:4:8] [async-threads:4]
Starting emqx on node emqx@127.0.0.1
Start mqtt:tcp:internal listener on 127.0.0.1:11883 successfully.
2023-07-27T09:38:21.642647+08:00 [error] mqtt:tcp failed to listen on 1883 - eaddrinuse (address already in use)
Failed to start mqtt listener mqtt:tcp:external on 0.0.0.0:1883: {eaddrinuse,{child,undefined,{listener_sup,{‘mqtt:tcp’,{{0,0,0,0},1883}}},{esockd_listener_sup,start_link,[tcp,‘mqtt:tcp’,{{0,0,0,0},1883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{send_timeout,15000},{send_timeout_close,true},{high_watermark,1048576}]},{acceptors,8},{max_connections,1024000},{max_conn_rate,{1000,1}},{access_rules,[{allow,all}]}],{emqx_connection,start_link,[[{listener_id,<<“mqtt:tcp:external”>>},{deflate_options,[]},{max_conn_rate,1000},{active_n,100},{zone,external},{proxy_address_header,<<>>},{proxy_port_header,<<>>},{supported_subprotocols,[]}]]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}}
2023-07-27T09:38:21.643625+08:00 [error] crasher: initial call: esockd_listener:init/1, pid: <0.1838.0>, registered_name: [], exit: {eaddrinuse,[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,407}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.1835.0>,esockd_sup,<0.1646.0>], message_queue_len: 0, messages: [], links: [<0.1835.0>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 28, reductions: 4213; neighbours:
2023-07-27T09:38:21.646244+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.1669.0>, registered_name: [], exit: {{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{eaddrinuse,{child,undefined,{listener_sup,{‘mqtt:tcp’,{{0,0,0,0},1883}}},{esockd_listener_sup,start_link,[tcp,‘mqtt:tcp’,{{0,0,0,0},1883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{send_timeout,15000},{send_timeout_close,true},{high_watermark,1048576}]},{acceptors,8},{max_connections,1024000},{max_conn_rate,{1000,1}},{access_rules,[{allow,all}]}],{emqx_connection,start_link,[[{listener_id,<<“mqtt:tcp:external”>>},{deflate_options,[]},{max_conn_rate,1000},{active_n,100},{zone,external},{proxy_address_header,<<>>},{proxy_port_header,<<>>},{supported_subprotocols,[]}]]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}},[{emqx_listeners,start_listener,1,[{file,“emqx_listeners.erl”},{line,120}]},{lists,foreach,2,[{file,“lists.erl”},{line,1342}]},{emqx_app,start,2,[{file,“emqx_app.erl”},{line,53}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,293}]}]}}}},[{application_master,init,4,[{file,“application_master.erl”},{line,142}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.1668.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.1670.0>,normal}], links: [<0.1668.0>,<0.1516.0>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 28, reductions: 317; neighbours:
[os_mon] memory supervisor port (memsup): Erlang has closed
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
{“Kernel pid terminated”,application_controller,“{application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{eaddrinuse,{child,undefined,{listener_sup,{‘mqtt:tcp’,{{0,0,0,0},1883}}},{esockd_listener_sup,start_link,[tcp,‘mqtt:tcp’,{{0,0,0,0},1883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{send_timeout,15000},{send_timeout_close,true},{high_watermark,1048576}]},{acceptors,8},{max_connections,1024000},{max_conn_rate,{1000,1}},{access_rules,[{allow,all}]}],{emqx_connection,start_link,[[{listener_id,<<"mqtt:tcp:external">>},{deflate_options,[]},{max_conn_rate,1000},{active_n,100},{zone,external},{proxy_address_header,<<>>},{proxy_port_header,<<>>},{supported_subprotocols,[]}]]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}},[{emqx_listeners,start_listener,1,[{file,"emqx_listeners.erl"},{line,120}]},{lists,foreach,2,[{file,"lists.erl"},{line,1342}]},{emqx_app,start,2,[{file,"emqx_app.erl"},{line,53}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}}}”}
Kernel pid terminated (application_controller) ({application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{eaddrinuse,{child,undefined,{listener_sup,{‘mqtt:tcp’,{{0,0,0,0},1883}}},{esockd_listener_sup,start_link,[tcp,‘mqtt:tcp’,{{0,0,0,0},1883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{send_timeout,15000},{send_timeout_close,true},{high_watermark,1048576}]},{acceptors,8},{max_connections,1024000},{max_conn_rate,{1000,1}},{access_rules,[{allow,all}]}],{emqx_connection,start_link,[[{listener_id,<<“mqtt:tcp:external”>>},{deflate_options,[]},{max_conn_rate,1000},{active_n,100},{zone,external},{proxy_address_header,<<>>},{proxy_port_header,<<>>},{supported_subprotocols,[]}]]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}},[{emqx_listeners,start_listener,1,[{file,“emqx_listeners.erl”},{line,120}]},{lists,foreach,2,[{file,“lists.erl”},{line,1342}]},{emqx_app,start,2,[{file,“emqx_app.erl”},{line,53}]},{application_master,start_it_old,4,
Crash dump is being written to: log/crash.dump…done
安装了5.0.26 ,没有改过配置出现以下错误
改动emqx/etc/emqx.cnf文件,再次启动一直等待还是失败
以下是5.0.26的日志信息
root@ubuntu:/sunyard/lab420/emqx/bin# emqx console
WARNING: Default (insecure) Erlang cookie is in use.
WARNING: Configure node.cookie in /sunyard/lab420/emqx/etc/emqx.conf or override from environment variable EMQX_NODE__COOKIE
WARNING: NOTE: Use the same cookie for all nodes in the cluster.
Erlang/OTP 24 [erts-12.3.2.2] [emqx] [64-bit] [smp:4:4] [ds:4:4:8] [async-threads:4]
Listener ssl:default on 0.0.0.0:8883 started.
2023-07-27T09:54:26.964022+08:00 [error] tcp:default failed to listen on 1883 - eaddrinuse (address already in use)
Failed to start listener tcp:default on 0.0.0.0:1883: {eaddrinuse,{child,undefined,{listener_sup,{‘tcp:default’,{{0,0,0,0},1883}}},{esockd_listener_sup,start_link,[tcp,‘tcp:default’,{{0,0,0,0},1883},[{tcp_options,[binary,{packet,raw},{reuseaddr,true},{backlog,1024},{nodelay,true},{buffer,4096},{high_watermark,1048576},{send_timeout,15000},{send_timeout_close,true}]},{acceptors,16},{access_rules,[{allow,all}]},{max_connections,5000000},{proxy_protocol,false},{proxy_protocol_timeout,3000},{tune_fun,{emqx_olp,backoff_new_conn,[default]}}],{emqx_connection,start_link,[#{enable_authn => true,limiter => undefined,listener => {tcp,default},zone => default}]}]},transient,false,infinity,supervisor,[esockd_listener_sup]}}.
2023-07-27T09:54:26.965297+08:00 [error] crasher: initial call: esockd_listener:init/1, pid: <0.2290.0>, registered_name: [], exit: {eaddrinuse,[{gen_server,init_it,6,[{file,“gen_server.erl”},{line,407}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.2287.0>,esockd_sup,<0.1999.0>], message_queue_len: 0, messages: [], links: [<0.2287.0>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 28, reductions: 4207; neighbours:
2023-07-27T09:54:26.967876+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.2163.0>, registered_name: [], exit: {{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{failed_to_start,“tcp:default(0.0.0.0:1883) : eaddrinuse”},[{emqx_listeners,‘-foreach_listeners/1-fun-0-’,2,[{file,“emqx_listeners.erl”},{line,723}]},{lists,foreach,2,[{file,“lists.erl”},{line,1342}]},{emqx_app,maybe_start_listeners,0,[{file,“emqx_app.erl”},{line,94}]},{emqx_app,start,2,[{file,“emqx_app.erl”},{line,50}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,293}]}]}}}},[{application_master,init,4,[{file,“application_master.erl”},{line,142}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.2162.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.2164.0>,normal}], links: [<0.2162.0>,<0.1758.0>], dictionary: [], trap_exit: true, status: running, heap_size: 987, stack_size: 28, reductions: 186; neighbours:
[os_mon] memory supervisor port (memsup): Erlang has closed
[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
{“Kernel pid terminated”,application_controller,“{application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{failed_to_start,"tcp:default(0.0.0.0:1883) : eaddrinuse"},[{emqx_listeners,‘-foreach_listeners/1-fun-0-’,2,[{file,"emqx_listeners.erl"},{line,723}]},{lists,foreach,2,[{file,"lists.erl"},{line,1342}]},{emqx_app,maybe_start_listeners,0,[{file,"emqx_app.erl"},{line,94}]},{emqx_app,start,2,[{file,"emqx_app.erl"},{line,50}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,293}]}]}}}}}”}
Kernel pid terminated (application_controller) ({application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{‘EXIT’,{{failed_to_start,“tcp:default(0.0.0.0:1883) : eaddrinuse”},[{emqx_listeners,‘-foreach_listeners/1-fun-0-’,2,[{file,“emqx_listeners.erl”},{line,723}]},{lists,foreach,2,[{file,“lists.erl”},{line,1342}]},{emqx_app,maybe_start_listeners,0,[{file,“emqx_app.erl”},{line,94}]},{emqx_app,start,2,[{file,“emqx_app.erl”},{line,50}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,293}]}]}}}}})
Crash dump is being written to: /sunyard/lab420/emqx/log/erl_crash.dump…done
希望大家可以帮忙看看是什么原因