MQTT研究之EMQ:【EMQX使用中的一些問題記錄(3)】

EMQX功能強大,可是幫助信息或者可用資料的確有限,遇到個問題,比較難找處處理的頭緒,今天,我要記錄的是,使用中出現EMQX宕機,可是呢,啓動也啓動不了。 今天記錄的內容,就以操做EMQX 3.2.3的版原本說吧。node

 

你可能看到有下面的信息:app

[root@tkwh-kfcs-app3 emqx]# emqx start
emqx v3.2.3 is started successfully!

可是呢,你查看狀態,又會看到下面的內容:socket

[root@tkwh-kfcs-app3 emqx]# emqx_ctl status
Node 'emqx@10.95.200.13' not responding to pings

 

這個是什麼狀況呢?其實就是EMQX啓動異常了,而後又shutdown了,看看日誌,在/var/log/emqx下面的 erlang.log.1 文件裏面能夠找到些許的信息。async

      1 
      2 =====
      3 ===== LOGGING STARTED Fri Oct 25 10:55:38 CST 2019
      4 =====
      5 Exec: /usr/lib/emqx/erts-10.3/bin/erlexec -boot /usr/lib/emqx/releases/v3.2.3/emqx -mode embedded -boot_var ERTS_LIB_DIR /usr/lib/emqx/erts-10.3/../lib -mnesia dir "/var/lib/emqx/mnesia/emqx@10.95.200.13" -config /var/lib/emqx/c
        onfigs/app.2019.10.25.10.55.38.config -args_file /var/lib/emqx/configs/vm.2019.10.25.10.55.38.args -vm_args /var/lib/emqx/configs/vm.2019.10.25.10.55.38.args -- console^M
      6 Root: /usr/lib/emqx^M
      7 /usr/lib/emqx^M
      8 Erlang/OTP 21 [erts-10.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:128] [hipe]^M
      9 ^M
     10 2019-10-25 10:55:43.487 [info] event=server_setup_successfully driver=tcp socket="#Port<0.8>"^M
     11 2019-10-25 10:55:43.488 [info] event=start^M
     12 Starting emqx on node emqx@10.95.200.13^M
     13 2019-10-25 10:55:43.562 [info] Ekka(Membership): Node emqx@10.95.200.22 up^M
     14 2019-10-25 10:55:43.580 [notice] application: emqx^M
     15     exited: {bad_return,^M
     16              {{emqx_app,start,[normal,[]]},^M
     17               {'EXIT',^M
     18                {{badmatch,^M
     19                  {error,^M
     20                   {shutdown,^M
     21                    {failed_to_start_child,emqx_router_sup,^M
     22                     {shutdown,^M
     23                      {failed_to_start_child,helper,^M
     24                       {{badmatch,{error,{not_active_local,emqx_routing_node}}},^M
     25                        [{emqx_router_helper,init,1,^M
     26                          [{file,^M
     27                            "/emqx_temp/emqx_rel/_checkouts/emqx/src/emqx_router_helper.erl"},^M
     28                           {line,95}]},^M
     29                         {gen_server,init_it,2,^M
     30                          [{file,"gen_server.erl"},{line,374}]},^M
     31                         {gen_server,init_it,6,^M
     32                          [{file,"gen_server.erl"},{line,342}]},^M
     33                         {proc_lib,init_p_do_apply,3,^M
     34                          [{file,"proc_lib.erl"},{line,249}]}]}}}}}}},^M
     35                 [{emqx_app,start,2,^M
     36                   [{file,^M
     37                     "/emqx_temp/emqx_rel/_checkouts/emqx/src/emqx_app.erl"},^M
     38                    {line,32}]},^M
     39                  {application_master,start_it_old,4,^M
     40                   [{file,"application_master.erl"},{line,277}]}]}}}}^M
     41     type: permanent^M
     42 [os_mon] memory supervisor port (memsup): Erlang has closed^M
     43 [os_mon] cpu supervisor port (cpu_sup): Erlang has closed^M
     44 {"Kernel pid terminated",application_controller,"{application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_router_sup,{shutdown,{failed_to_start_chi
        ld,helper,{{badmatch,{error,{not_active_local,emqx_routing_node}}},[{emqx_router_helper,init,1,[{file,\"/emqx_temp/emqx_rel/_checkouts/emqx/src/emqx_router_helper.erl\"},{line,95}]},{gen_server,init_it,2,[{file,\"gen_server.erl\
        "},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,249}]}]}}}}}}},[{emqx_app,start,2,[{file,\"/emqx_temp/emqx_rel/_checkouts/emqx/src/emqx_app
        .erl\"},{line,32}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,277}]}]}}}}}"}^M^M
     45 Kernel pid terminated (application_controller) ({application_start_failure,emqx,{bad_return,{{emqx_app,start,[normal,[]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,emqx_router_sup,{sh^M^M
     46 ^M^M
     47 Crash dump is being written to: /var/log/emqx/crash.dump...done^M^M

什麼意思呢?其實就是在安裝路徑的/var/lib/emqx下面有些異常數據,致使emqx啓動時作數據同步時,出現錯誤,最後就宕機了。解決辦法,就是將/var/lib/emqx下的數據清除掉,而後從新安裝,固然,相關的配置,須要再次配置一下。tcp

 

最後,再次將emqx安裝一遍,就沒有什麼問題了。spa

相關文章
相關標籤/搜索