fix issue #121, unload plugins, stop/start gproc app when clustering...
This commit is contained in:
parent
14421dae5b
commit
a7344248e4
|
@ -75,12 +75,21 @@ cluster([SNode]) ->
|
|||
Node = node_name(SNode),
|
||||
case net_adm:ping(Node) of
|
||||
pong ->
|
||||
case emqttd:is_running(Node) of
|
||||
true ->
|
||||
%%TODO: should not unload here.
|
||||
emqttd:unload_all_plugins(),
|
||||
application:stop(emqttd),
|
||||
application:stop(esockd),
|
||||
application:stop(gproc),
|
||||
emqttd_mnesia:cluster(Node),
|
||||
application:start(gproc),
|
||||
application:start(esockd),
|
||||
application:start(emqttd),
|
||||
?PRINT("cluster with ~p successfully.~n", [Node]);
|
||||
false ->
|
||||
?PRINT("emqttd is not running on ~p~n", [Node])
|
||||
end;
|
||||
pang ->
|
||||
?PRINT("failed to connect to ~p~n", [Node])
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue