plugins 命令

plugins 命令用于加载、卸载、查询插件应用。 EMQ X 消息服务器通过插件扩展认证、定制功能,插件置于 plugins/ 目录下。

plugins list列出全部插件(Plugin)
plugins load <Plugin>加载插件(Plugin)
plugins unload <Plugin>卸载插件(Plugin)
plugins reload <Plugin>重载插件(Plugin)

Tip

当修改完成某插件的配置文件时,若需要立即生效则需要执行 reload 命令。因为 unload/load 命令不会编译新的配置文件

plugins list

列出全部插件:

  1. $ ./bin/emqx_ctl plugins list
  2. Plugin(emqx_auth_clientid, version=v3.1.0, description=EMQ X Authentication with ClientId/Password, active=false)
  3. Plugin(emqx_auth_http, version=v3.1.0, description=EMQ X Authentication/ACL with HTTP API, active=false)
  4. Plugin(emqx_auth_jwt, version=v3.1.0, description=EMQ X Authentication with JWT, active=false)
  5. Plugin(emqx_auth_ldap, version=v3.1.0, description=EMQ X Authentication/ACL with LDAP, active=false)
  6. Plugin(emqx_auth_mongo, version=v3.1.0, description=EMQ X Authentication/ACL with MongoDB, active=false)
  7. Plugin(emqx_auth_mysql, version=v3.1.0, description=EMQ X Authentication/ACL with MySQL, active=false)
  8. Plugin(emqx_auth_pgsql, version=v3.1.0, description=EMQ X Authentication/ACL with PostgreSQL, active=false)
  9. Plugin(emqx_auth_redis, version=v3.1.0, description=EMQ X Authentication/ACL with Redis, active=false)
  10. Plugin(emqx_auth_username, version=v3.1.0, description=EMQ X Authentication with Username and Password, active=false)
  11. Plugin(emqx_coap, version=v3.1.0, description=EMQ X CoAP Gateway, active=false)
  12. Plugin(emqx_dashboard, version=v3.1.0, description=EMQ X Web Dashboard, active=true)
  13. Plugin(emqx_delayed_publish, version=v3.1.0, description=EMQ X Delayed Publish, active=false)
  14. Plugin(emqx_lua_hook, version=v3.1.0, description=EMQ X Lua Hooks, active=false)
  15. Plugin(emqx_lwm2m, version=v3.1.0, description=EMQ X LwM2M Gateway, active=false)
  16. Plugin(emqx_management, version=v3.1.0, description=EMQ X Management API and CLI, active=true)
  17. Plugin(emqx_plugin_template, version=v3.1.0, description=EMQ X Plugin Template, active=false)
  18. Plugin(emqx_psk_file, version=v3.1.0, description=EMQX PSK Plugin from File, active=false)
  19. Plugin(emqx_recon, version=v3.1.0, description=EMQ X Recon Plugin, active=true)
  20. Plugin(emqx_reloader, version=v3.1.0, description=EMQ X Reloader Plugin, active=false)
  21. Plugin(emqx_retainer, version=v3.1.0, description=EMQ X Retainer, active=true)
  22. Plugin(emqx_rule_engine, version=v3.1.0, description=EMQ X Rule Engine, active=true)
  23. Plugin(emqx_sn, version=v3.1.0, description=EMQ X MQTT SN Plugin, active=false)
  24. Plugin(emqx_statsd, version=v3.1.0, description=Statsd for EMQ X, active=false)
  25. Plugin(emqx_stomp, version=v3.1.0, description=EMQ X Stomp Protocol Plugin, active=false)
  26. Plugin(emqx_web_hook, version=v3.1.0, description=EMQ X Webhook Plugin, active=false)

插件属性:

version插件版本
description插件描述
active是否已加载

plugins load <Plugin>

加载插件:

  1. $ ./bin/emqx_ctl plugins load emqx_lua_hook
  2. Start apps: [emqx_lua_hook]
  3. Plugin emqx_lua_hook loaded successfully.

plugins unload <Plugin>

卸载插件:

  1. $ ./bin/emqx_ctl plugins unload emqx_lua_hook
  2. Plugin emqx_lua_hook unloaded successfully.

plugins reload <Plugin>

重载插件:

  1. $ ./bin/emqx_ctl plugins reload emqx_lua_hook
  2. Plugin emqx_lua_hook reloaded successfully.