EMQX启动失败

报错提示:
ERROR: /usr/lib/emqx/erts-14.2.5.2/bin/beam.smp: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
ERROR: Please ensure it is running on the correct platform:
ERROR: arch: “x86_64-pc-linux-gnu”
wordsize: 64
os: “el8”
erlang: “26.2.5.2-1”
elixir: “none”
relform: “rpm”
ERROR: Version=5.8.0
ERROR: Required dependencies: openssl-1.1.1 (libcrypto), libncurses and libatomic1

我安装文档下载的rpm包,是还缺少东西吗

你好,方便给出你所安装的操作系统,和下载的安装包名称、执行的安装指令吗?

安装的操作系统linux,安装包名emqx-5.8.0-el8-amd64.rpm,执行命令sudo yum install emqx-5.8.0-el8-amd64.rpm -y启动
sudo systemctl start emqx

我换了一个安装包:emqx-4.4.18-otp24.3.4.2-1-el7-amd64.rpm启动的时候提示Job for emqx.service failed because a timeout was exceeded. See “systemctl status emqx.service” and “journalctl -xe” for details.

看看这个的结果?

你的操作系统是centos7 还是8?

操作系统是centos7,执行命令后:
● emqx.service - emqx daemon
Loaded: loaded (/usr/lib/systemd/system/emqx.service; enabled; vendor preset: disabled)
Active: activating (start) since 三 2024-09-25 10:51:01 CST; 9s ago
Control: 18200 (bash)
Tasks: 53
Memory: 96.6M
CGroup: /system.slice/emqx.service
├─18200 /bin/bash /usr/bin/emqx start
├─18365 /usr/lib/emqx/erts-12.3.2.2/bin/run_erl -daemon //var/lib/emqx/emqx_erl_pipes/emqx@127.0.0.1/ /var/log/emqx exec “/usr/bin/emqx” “console”
├─18395 bash /usr/bin/emqx console
├─18455 /usr/lib/emqx/bin/cuttlefish -B -A 0 – -root /usr/lib/emqx -progname /usr/lib/emqx/erts-12.3.2.2/bin/erl – -home /var/lib/emqx – -boot no_dot_erlang -noshell -esc…
├─18459 erl_child_setup 1048576
├─18480 /usr/lib/emqx/bin/nodetool -B – -root /usr/lib/emqx -progname /usr/lib/emqx/erts-12.3.2.2/bin/erl – -home /var/lib/emqx – -boot no_dot_erlang -noshell -run escrip…
└─18484 erl_child_setup 1048576

9月 25 10:51:01 localhost.localdomain systemd[1]: Starting emqx daemon…

执行命令journalctl -xe :
25 10:45:00 localhost.localdomain systemd[1]: emqx.service start operation timed out. Terminating.
9月 25 10:45:00 localhost.localdomain systemd[1]: Failed to start emqx daemon.
– Subject: Unit emqx.service has failed
– Defined-By: systemd
– Support: systemd-devel Info Page

– Unit emqx.service has failed.

– The result is failed.
9月 25 10:45:00 localhost.localdomain systemd[1]: Unit emqx.service entered failed state.
9月 25 10:45:00 localhost.localdomain systemd[1]: emqx.service failed.
9月 25 10:45:00 localhost.localdomain categraf[5643]: 2024/09/25 10:45:00 writer.go:105: W! push data with remote write request got error: Post "http://192.168.15.81:17000/prometheus/v1/w
9月 25 10:45:00 localhost.localdomain categraf[5643]: 2024/09/25 10:45:00 writer.go:75: W! post to http://192.168.15.81:17000/prometheus/v1/write got error: Post "http://192.168.15.81:170
9月 25 10:45:00 localhost.localdomain categraf[5643]: 2024/09/25 10:45:00 writer.go:76: W! example timeseries: labels:<name:“name” value:“net_bits_sent” > labels:<name:“interface” val
lines 1026-1066/1066 (END)

没看到有明显的错误…

把他 stop 掉,然后手动拉看看输出什么

sudo systemctl stop emqx
sudo emqx console

[root@localhost ~]# sudo emqx console
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.
Start mqtt:tcp:external listener on 0.0.0.0:1883 successfully.
Failed to start mqtt listener mqtt:ws:external on 0.0.0.0:8083: eaddrinuse
2024-09-25T11:17:21.477923+08:00 [error] Failed to start Ranch listener ‘mqtt:ws:8083’ in ranch_tcp:listen([{cacerts,‘…’},{key,‘…’},{cert,‘…’},{port,8083},{backlog,1024},{send_timeout,15000},{send_timeout_close,true},{nodelay,true}]) for reason eaddrinuse (address already in use)
2024-09-25T11:17:21.478281+08:00 [error] Supervisor: {<0.1833.0>,ranch_listener_sup}. Context: start_error. Reason: {listen_error,‘mqtt:ws:8083’,eaddrinuse}. Offender: id=ranch_acceptors_sup,pid=undefined.
2024-09-25T11:17:21.478624+08:00 [error] crasher: initial call: supervisor:ranch_acceptors_sup/1, pid: <0.1835.0>, registered_name: , exit: {{listen_error,‘mqtt:ws:8083’,eaddrinuse},[{ranch_acceptors_sup,listen_error,5,[{file,“ranch_acceptors_sup.erl”},{line,66}]},{supervisor,init,1,[{file,“supervisor.erl”},{line,330}]},{gen_server,init_it,2,[{file,“gen_server.erl”},{line,423}]},{gen_server,init_it,6,[{file,“gen_server.erl”},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.1833.0>,ranch_sup,<0.1639.0>], message_queue_len: 0, messages: , links: [<0.1833.0>], dictionary: [{logger,error_logger}], trap_exit: true, status: running, heap_size: 2586, stack_size: 28, reductions: 8313; neighbours:
2024-09-25T11:17:21.479142+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.1655.0>, registered_name: , exit: {{bad_return,{{emqx_app,start,[normal,]},{‘EXIT’,{eaddrinuse,[{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.1654.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.1656.0>,normal}], links: [<0.1654.0>,<0.1503.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 277; 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,[{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,[{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}]}]}}}}})

Crash dump is being written to: /var/log/emqx/crash.dump…done

我改成listener.ws.external = 8084还是不行,提示 2024-09-25T11:26:34.668134+08:00 [error] Failed to start Ranch listener ‘mqtt:wss:8084’ in ranch_ssl:listen([{cacerts,‘…’},{key,‘…’},{cert,‘…’},{next_protocols_advertised,[<<“h2”>>,<<“http/1.1”>>]},{alpn_preferred_protocols,[<<“h2”>>,<<“http/1.1”>>]},{port,8084},{backlog,1024},{send_timeout,15000},{send_timeout_close,true},{nodelay,true},{ciphers,[“TLS_AES_256_GCM_SHA384”,“TLS_AES_128_GCM_SHA256”,“TLS_CHACHA20_POLY1305_SHA256”,“TLS_AES_128_CCM_SHA256”,“TLS_AES_128_CCM_8_SHA256”,“ECDHE-ECDSA-AES256-GCM-SHA384”,“ECDHE-RSA-AES256-GCM-SHA384”,“ECDHE-ECDSA-AES256-SHA384”,“ECDHE-RSA-AES256-SHA384”,“ECDHE-ECDSA-DES-CBC3-SHA”,“ECDH-ECDSA-AES256-GCM-SHA384”,“ECDH-RSA-AES256-GCM-SHA384”,“ECDH-ECDSA-AES256-SHA384”,“ECDH-RSA-AES256-SHA384”,“DHE-DSS-AES256-GCM-SHA384”,“DHE-DSS-AES256-SHA256”,“AES256-GCM-SHA384”,“AES256-SHA256”,“ECDHE-ECDSA-AES128-GCM-SHA256”,“ECDHE-RSA-AES128-GCM-SHA256”,“ECDHE-ECDSA-AES128-SHA256”,“ECDHE-RSA-AES128-SHA256”,“ECDH-ECDSA-AES128-GCM-SHA256”,“ECDH-RSA-AES128-GCM-SHA256”,“ECDH-ECDSA-AES128-SHA256”,“ECDH-RSA-AES128-SHA256”,“DHE-DSS-AES128-GCM-SHA256”,“DHE-DSS-AES128-SHA256”,“AES128-GCM-SHA256”,“AES128-SHA256”,“ECDHE-ECDSA-AES256-SHA”,“ECDHE-RSA-AES256-SHA”,“DHE-DSS-AES256-SHA”,“ECDH-ECDSA-AES256-SHA”,“ECDH-RSA-AES256-SHA”,“AES256-SHA”,“ECDHE-ECDSA-AES128-SHA”,“ECDHE-RSA-AES128-SHA”,“DHE-DSS-AES128-SHA”,“ECDH-ECDSA-AES128-SHA”,“ECDH-RSA-AES128-SHA”,“AES128-SHA”]},{depth,10},{keyfile,“/etc/emqx/certs/key.pem”},{certfile,“/etc/emqx/certs/cert.pem”},{reuse_sessions,true}]) for reason eaddrinuse (address already in use)

2024-09-25T11:26:34.668829+08:00 [error] Supervisor: {<0.1860.0>,ranch_listener_sup}. Context: start_error. Reason: {listen_error,‘mqtt:wss:8084’,eaddrinuse}. Offender: id=ranch_acceptors_sup,pid=undefined.

Failed to start mqtt listener mqtt:wss:external on 0.0.0.0:8084: eaddrinuse

2024-09-25T11:26:34.669180+08:00 [error] crasher: initial call: supervisor:ranch_acceptors_sup/1, pid: <0.1862.0>, registered_name: , exit: {{listen_error,‘mqtt:wss:8084’,eaddrinuse},[{ranch_acceptors_sup,listen_error,5,[{file,“ranch_acceptors_sup.erl”},{line,66}]},{supervisor,init,1,[{file,“supervisor.erl”},{line,330}]},{gen_server,init_it,2,[{file,“gen_server.erl”},{line,423}]},{gen_server,init_it,6,[{file,“gen_server.erl”},{line,390}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,226}]}]}, ancestors: [<0.1860.0>,ranch_sup,<0.1639.0>], message_queue_len: 0, messages: , links: [<0.1860.0>], dictionary: [{logger,error_logger}], trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 40744; neighbours:

2024-09-25T11:26:34.669937+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.1655.0>, registered_name: , exit: {{bad_return,{{emqx_app,start,[normal,]},{‘EXIT’,{eaddrinuse,[{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.1654.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.1656.0>,normal}], links: [<0.1654.0>,<0.1503.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 333; 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,[{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,[{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}]}]}}}}})

Crash dump is being written to: /var/log/emqx/crash.dump…done

是不是已经有一个 emqx 启动了?没有systemctl stop 么

没有,执行了systemctl stop

Start mqtt:ws:external listener on 0.0.0.0:8084 successfully.
[error] Failed to start Ranch listener ‘mqtt:wss:8084’ in

配置的端口重复了