fix cluster
This commit is contained in:
parent
60b42661b1
commit
dbad1cf920
|
@ -1,5 +1,5 @@
|
||||||
## Name of the node
|
## Name of the node
|
||||||
-name emqtt@127.0.0.1
|
-sname emqtt
|
||||||
|
|
||||||
## Cookie for distributed erlang
|
## Cookie for distributed erlang
|
||||||
-setcookie emqtt
|
-setcookie emqtt
|
||||||
|
|
|
@ -22,8 +22,9 @@ cluster_info([]) ->
|
||||||
Nodes = [node()|nodes()],
|
Nodes = [node()|nodes()],
|
||||||
?PRINT("cluster nodes: ~p~n", [Nodes]).
|
?PRINT("cluster nodes: ~p~n", [Nodes]).
|
||||||
|
|
||||||
cluster([Node]) ->
|
cluster([SNode]) ->
|
||||||
case net_adm:ping(list_to_atom(Node)) of
|
Node = list_to_atom(SNode),
|
||||||
|
case net_adm:ping(Node) of
|
||||||
pong ->
|
pong ->
|
||||||
application:stop(emqtt),
|
application:stop(emqtt),
|
||||||
mnesia:stop(),
|
mnesia:stop(),
|
||||||
|
|
Loading…
Reference in New Issue