diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-04-29 11:26:36 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-04-29 11:26:36 +0100 |
commit | 12b4ef231f0279173159c8fa0312832219249484 (patch) | |
tree | b3e7c1891ee18fc0cf209d177324459cbee8da13 /src/rabbit_nodes.erl | |
parent | f8ac89a9c92863dfb7eb9faeb812b166aafc3093 (diff) | |
download | rabbitmq-server-12b4ef231f0279173159c8fa0312832219249484.tar.gz |
Attempt to make diagnostics even clearer.
Diffstat (limited to 'src/rabbit_nodes.erl')
-rw-r--r-- | src/rabbit_nodes.erl | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/rabbit_nodes.erl b/src/rabbit_nodes.erl index 9d8606be..7f7fcc31 100644 --- a/src/rabbit_nodes.erl +++ b/src/rabbit_nodes.erl @@ -81,10 +81,12 @@ diagnostics_node(Node) -> [{" * unable to connect to epmd (port ~s) on ~s: ~s~n", [epmd_port(), Host, rabbit_misc:format_inet_error(Reason)]}]; {ok, NamePorts} -> - case net_adm:ping(Node) of - pong -> dist_working_diagnostics(Node); - pang -> dist_broken_diagnostics(Name, Host, NamePorts) - end + [{" * connected to epmd (port ~s) on ~s", + [epmd_port(), Host]}] ++ + case net_adm:ping(Node) of + pong -> dist_working_diagnostics(Node); + pang -> dist_broken_diagnostics(Name, Host, NamePorts) + end end]. epmd_port() -> @@ -95,11 +97,11 @@ epmd_port() -> dist_working_diagnostics(Node) -> case rabbit:is_running(Node) of - true -> [{" * node up, rabbit application running~n", []}]; - false -> [{" * node up, rabbit application not running~n" + true -> [{" * node ~s up, 'rabbit' application running", [Node]}]; + false -> [{" * node ~s up, 'rabbit' application not running~n" " * running applications on ~s: ~p~n" - " * suggestion: start_app on ~s~n", - [Node, remote_apps(Node), Node]}] + " * suggestion: start_app on ~s", + [Node, Node, remote_apps(Node), Node]}] end. remote_apps(Node) -> @@ -119,13 +121,16 @@ dist_broken_diagnostics(Name, Host, NamePorts) -> Host -> SelfName; _ -> never_matches end], - [{" * ~s seems not to be running at all", [Name]} | - case Others of - [] -> [{" * no other nodes on ~s", [Host]}]; - _ -> [{" * other nodes on ~s: ~p", [Host, Others]}] - end]; + OthersDiag = case Others of + [] -> [{" no other nodes on ~s", + [Host]}]; + _ -> [{" other nodes on ~s: ~p", + [Host, Others]}] + end, + [{" * epmd reports: node '~s' not running at all", [Name]}, + OthersDiag, {" * suggestion: start the node", []}]; [{Name, Port}] -> - [{" * found ~s (port ~b)", [Name, Port]} | + [{" * epmd reports node '~s' running on port ~b", [Name, Port]} | case diagnose_connect(Host, Port) of ok -> [{" * TCP connection succeeded but Erlang distribution " |