-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bin/emqx): diagnose boot failure
Prior to this change, when EMQX daemon mode failed to start it's not quite easy for users to understand what went wrong. All the know is the node did not start in time and then instructed to boot the node in 'console' mode wishing for some logs. However, the node might actuay be running, causing 'console' mode to fail with a different reason. With this change, after a filure of daemon mode boot, we issue a diagnosis. 1. if node can not be found from ps -ef, instruct the user to find information in erlang.log.N 2. if the node is found running, but not responding to pings instruct the user to check if the node name is resolvable and reachable 3. if the node is responding to pings but emqx app is not running, then it's likely a bug. so the user is advised to report a github issue.
- Loading branch information
Showing
4 changed files
with
101 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Improve daemon mode startup failure logs. | ||
|
||
Before this change, it was difficult for users to understand the reason for EMQX 'start' command failed to boot the node. | ||
The only information they received was that the node did not start within the expected time frame, | ||
and they were instructed to boot the node with 'console' command in the hope of obtaining some logs. | ||
However, the node might actually be running, which could cause 'console' mode to fail for a different reason. | ||
|
||
With this new change, when daemon mode fails to boot, a diagnosis is issued. Here are the possible scenarios: | ||
|
||
* If the node cannot be found from `ps -ef`, the user is instructed to find information in log files `erlang.log.*`. | ||
* If the node is found to be running but not responding to pings, the user is advised to check if the host name is resolvable and reachable. | ||
* If the node is responding to pings, but the EMQX app is not running, it is likely a bug. In this case, the user is advised to report a Github issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
优化 EMQX daemon 模式启动启动失败的日志。 | ||
|
||
在进行此更改之前,当 EMQX 用 `start` 命令启动失败时,用户很难理解出错的原因。 | ||
所知道的仅仅是节点未能在预期时间内启动,然后被指示以 `console` 式引导节点以获取一些日志。 | ||
然而,节点实际上可能正在运行,这可能会导致 `console` 模式因不同的原因而失败。 | ||
|
||
此次修复后,启动脚本会发出诊断: | ||
|
||
* 如果无法从 `ps -ef` 中找到节点,则指示用户在 `erlang.log.*` 中查找信息。 | ||
* 如果发现节点正在运行但不响应 ping,则建议用户检查节点主机名是否有效并可达。 | ||
* 如果节点响应 ping 但 EMQX 应用程序未运行,则很可能是一个错误。在这种情况下,建议用户报告一个Github issue。 |