天天看點

我的mqtt協定和emqttd開源項目個人了解(16) - [error] Autocluster exception: {badmatch,undefined}

emq2.3.X會出現這個錯誤,怎麼破?出現這個錯誤,emq程式無法正常啟動,1883端口沒有在監聽。

emqttd broker is starting...[ok]

emqttd alarm is starting...[ok]

emqttd mod supervisor is starting...[ok]

emqttd bridge supervisor is starting...[ok]

emqttd access control is starting...[ok]

emqttd system monitor is starting...[ok]

emqttd 2.3.6 is running now

Eshell V9.3  (abort with ^G)

([email protected])1> 13:27:04.684 [error] Autocluster exception: {badmatch,undefined}

主要原因是emqttd_plugins.erl檔案的

plugin(CfgFile) ->

   {ok, Attrs} = application:get_all_key(AppName),

得不到正确的key導緻的。

([email protected])1> filelib:wildcard("*.{conf,config}", "etc/plugins/").

["emq_auth_clientid.conf","emq_auth_http.conf",

"emq_auth_jwt.conf","emq_auth_ldap.conf",

"emq_auth_mongo.conf","emq_auth_mysql.conf",

"emq_auth_pgsql.conf","emq_auth_redis.conf",

"emq_auth_username.conf","emq_coap.conf",

"emq_dashboard.conf","emq_lua_hook.conf","emq_modules.conf",

"emq_plugin_kafka_brod.config","emq_plugin_template.config",

"emq_recon.conf","emq_reloader.conf","emq_retainer.conf",

"emq_sn.conf","emq_stomp.conf","emq_web_hook.conf",

"firecat_api.conf","firecat_api.config",

"firecat_info.config"]

([email protected])2> application:get_all_key(firecat_info).

{ok,[{description,"emqttd info save to MySQL"},

    {id,[]},

    {vsn,"1.1.2"},

    {modules,[firecat_info_app,firecat_info_data,

              firecat_info_data_sup,firecat_info_mysql,

              firecat_info_mysql_sup]},

    {maxP,infinity},

    {maxT,infinity},

    {registered,[]},

    {included_applications,[]},

    {applications,[stdlib,kernel,ecpool,mysql]},

    {env,[{included_applications,[]}]},

    {mod,{firecat_info_app,[]}},

    {start_phases,undefined}]}

如果有問題會顯示undefined.

我的解決方法是:把deps檔案夾自己寫的插件删掉,再重新拷貝一份進來。/home/emqx-rel-2.3.11/data/loaded_plugins設定自啟動插件,裡面沒有的内容,deps檔案夾就不要有相應的插件源碼存在(僅針對自己寫的插件)。

繼續閱讀