fix cluster

This commit is contained in:
erylee 2012-12-27 16:51:32 +08:00
parent 60b42661b1
commit dbad1cf920
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
## Name of the node
-name emqtt@127.0.0.1
-sname emqtt
## Cookie for distributed erlang
-setcookie emqtt

View File

@ -22,8 +22,9 @@ cluster_info([]) ->
Nodes = [node()|nodes()],
?PRINT("cluster nodes: ~p~n", [Nodes]).
cluster([Node]) ->
case net_adm:ping(list_to_atom(Node)) of
cluster([SNode]) ->
Node = list_to_atom(SNode),
case net_adm:ping(Node) of
pong ->
application:stop(emqtt),
mnesia:stop(),