我的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文件夹就不要有相应的插件源码存在(仅针对自己写的插件)。

 

 

你可能感兴趣的:(Erlang)