emqx 奔溃后启动失败

环境

  • EMQX 版本:5.0.26
  • 操作系统版本:windows 11

安装成功后能正常使用,过程中 不记得做过什么特别的事情,emqx http://localhost:18083/ 突然打不开了,当时没有去检查,过了两天后发现服务未启动。 重启服务 启动不了。
相关日志信息:

2025-03-10T14:32:28.797000+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.409.0>, registered_name: , exit: {{bad_return,{{emqx_conf_app,start,[normal,]},{‘EXIT’,{{case_clause,undefined},[{emqx_config_logger,tr_console_handler,1,[{file,“emqx_config_logger.erl”},{line,129}]},{emqx_config_logger,tr_handlers,1,[{file,“emqx_config_logger.erl”},{line,124}]},{emqx_config_logger,do_refresh_config,1,[{file,“emqx_config_logger.erl”},{line,48}]},{emqx_conf_app,start,2,[{file,“emqx_conf_app.erl”},{line,39}]},{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.408.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.410.0>,normal}], links: [<0.408.0>,<0.44.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 29, reductions: 203; neighbours:
2025-03-10T14:33:37.007000+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.410.0>, registered_name: , exit: {{bad_return,{{emqx_conf_app,start,[normal,]},{‘EXIT’,{{case_clause,undefined},[{emqx_config_logger,tr_console_handler,1,[{file,“emqx_config_logger.erl”},{line,129}]},{emqx_config_logger,tr_handlers,1,[{file,“emqx_config_logger.erl”},{line,124}]},{emqx_config_logger,do_refresh_config,1,[{file,“emqx_config_logger.erl”},{line,48}]},{emqx_conf_app,start,2,[{file,“emqx_conf_app.erl”},{line,39}]},{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.409.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.411.0>,normal}], links: [<0.409.0>,<0.44.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 29, reductions: 201; neighbours:
2025-03-10T14:34:46.333000+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.409.0>, registered_name: , exit: {{bad_return,{{emqx_conf_app,start,[normal,]},{‘EXIT’,{{case_clause,undefined},[{emqx_config_logger,tr_console_handler,1,[{file,“emqx_config_logger.erl”},{line,129}]},{emqx_config_logger,tr_handlers,1,[{file,“emqx_config_logger.erl”},{line,124}]},{emqx_config_logger,do_refresh_config,1,[{file,“emqx_config_logger.erl”},{line,48}]},{emqx_conf_app,start,2,[{file,“emqx_conf_app.erl”},{line,39}]},{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.408.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.410.0>,normal}], links: [<0.408.0>,<0.44.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 29, reductions: 201; neighbours:
2025-03-10T14:35:57.006000+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.409.0>, registered_name: , exit: {{bad_return,{{emqx_conf_app,start,[normal,]},{‘EXIT’,{{case_clause,undefined},[{emqx_config_logger,tr_console_handler,1,[{file,“emqx_config_logger.erl”},{line,129}]},{emqx_config_logger,tr_handlers,1,[{file,“emqx_config_logger.erl”},{line,124}]},{emqx_config_logger,do_refresh_config,1,[{file,“emqx_config_logger.erl”},{line,48}]},{emqx_conf_app,start,2,[{file,“emqx_conf_app.erl”},{line,39}]},{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.408.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.410.0>,normal}], links: [<0.408.0>,<0.44.0>], dictionary: , trap_exit: true, status: running, heap_size: 610, stack_size: 29, reductions: 203; neighbours:

应该是有个变量没有?试试去掉 data/config/cluster.xxx 和 etc/emqx.conf 里面的 log 配置。
然后在 etc/emqx.conf 里面加上:log.console.enable=false 这一句。

PS: 5.0.x 已经过了维护周期了,有条件的建议升级一下哈产品生命周期结束日期 | EMQX文档

D:\emqx-5.3.2\data\configs 目录下没有 cluster.xxx

etc/emqx.conf 里面 也没有log 配置

node {
name = “emqx@127.0.0.1
cookie = “emqxsecretcookie”
data_dir = “data”
}

cluster {
name = emqxcl
discovery_strategy = manual
}

dashboard {
listeners.http {
bind = 18083
}
}

我重新安装了5.3.2 Windows 版本也是一样的情况,无法通过Windows 服务来启动emqx, 但是我使用 命令 start cmd /k “cd /d D:\emqx-5.3.2\bin &&emqx start” 启动 是正常的, 请问是什么原因啊? 哪个版本的 Windows emqx 可以在window服务中 运行尼? 我生产上只能用 windows 部署。 主要就是 服务器 给 300个左右的客户端 发送 启动指令, 并发量也不大。 类似扫码启动机器的场景。

emqx-5.3.2 Windows 服务启动 报的错误日志是一样的:
2025-03-11T09:58:09.545000+08:00 [error] crasher: initial call: application_master:init/4, pid: <0.400.0>, registered_name: , exit: {{bad_return,{{emqx_conf_app,start,[normal,]},{‘EXIT’,{{case_clause,undefined},[{emqx_config_logger,tr_console_handler,1,[{file,“emqx_config_logger.erl”},{line,131}]},{emqx_config_logger,tr_handlers,1,[{file,“emqx_config_logger.erl”},{line,126}]},{emqx_config_logger,do_refresh_config,1,[{file,“emqx_config_logger.erl”},{line,50}]},{emqx_conf_app,start,2,[{file,“emqx_conf_app.erl”},{line,38}]},{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,240}]}]}, ancestors: [<0.399.0>], message_queue_len: 1, messages: [{‘EXIT’,<0.401.0>,normal}], links: [<0.399.0>,<0.44.0>], dictionary: , trap_exit: true, status: running, heap_size: 376, stack_size: 28, reductions: 173; neighbours:

我在社区也找到和我类似的问题:emqx5.1.6 run error when install as a windows services · Issue #11537 · emqx/emqx · GitHub
Unable to open dashboard login page [error] crasher: initial call: application_master:init/4, pid: <0.442.0>, registered_name: [], exit: {{bad_return,{{emqx_conf_app,start,[normal,[]]} · Issue #12090 · emqx/emqx · GitHub

能否帮确认一下 哪个稳定版本 可以支持 Windows服务启动的尼?谢谢啦

@zhongwencool 求救求救 ,拜托了

  1. 这个是 bug 来的,强烈建议您使用 docker 安装最新版本。
  2. 如果你实在是有困难。不能装 docker。原则上我们是不支持 windows 了的。windows 我们是不再维护了的。 我也没有 window 环境,但是通过看代码,你可以试试:

configs 下没有 cluster.xx就更好了。
只需要加上:
log.console.enable=false 在 etc/emqx.conf应该就可以了。
如果还是不行,你可以试试用 docker 装最新版本,我也没有办法了哈。

还是不行,还是一样的错误, 现在只能曲线救国,VirtualBox + linux +docker +emqx。 但是这样部署 太难了。 我还是希望能 推荐我一个 windows 稳定版本,支持 Windows服务 启动的。这对我非常重要,拜托拜托 。

抱歉,现在不支持Windows 了,你可以直接在Windows下安docker 的