1、emq介绍
image.pngimage.png
image.png
image.png
2、安装emq
环境是centos7.2,
http://www.emqtt.com/downloads
对应的包地址是http://www.emqtt.com/downloads/3104/centos7
下载安装包
wget http://www.emqtt.com/downloads/3104/centos7
解压安装包
unzip centos7
查看目录
[root@iZwz94wxzv9g5iqyr8h3ktZ home]# ls
centos7 emqx jboot www wwwlogs wwwroot
[root@iZwz94wxzv9g5iqyr8h3ktZ home]#
3、运行emq相关命令行
https://developer.emqx.io/docs/emq/v3/cn/getstarted.html#emq
启动emqx
./bin/emqx start
检查运行状态
./bin/emqx_ctl status
[root@iZwz94wxzv9g5iqyr8h3ktZ emqx]# ./bin/emqx_ctl status
Usage: emqx_ctl
--------------------------------------------------------------------------------
rules list # List all rules
rules show <RuleId> # Show a rule
rules create # Create a rule
rules delete <RuleId> # Delete a rule
--------------------------------------------------------------------------------
rule-actions list # List all actions
rule-actions show <ActionId> # Show a rule action
--------------------------------------------------------------------------------
resources list # List all resources
resources show <ResourceId> # Show a resource
--------------------------------------------------------------------------------
resource-types list # List all resource-types
resource-types show <Type> # Show a resource-type
--------------------------------------------------------------------------------
recon memory # recon_alloc:memory/2
recon allocated # recon_alloc:memory(allocated_types, current|max)
recon bin_leak # recon:bin_leak(100)
recon node_stats # recon:node_stats(10, 1000)
recon remote_load Mod # recon:remote_load(Mod)
--------------------------------------------------------------------------------
retainer info # Show the count of retained messages
retainer topics # Show all topics of retained messages
retainer clean # Clean all retained messages
--------------------------------------------------------------------------------
admins add <Username> <Password> <Tags> # Add dashboard user
admins passwd <Username> <Password> # Reset dashboard user password
admins del <Username> # Delete dashboard user
停止emqx
./bin/emqx stop
4、控制台
EMQ X 消息服务器启动后,会默认加载 Dashboard 插件,启动 Web 管理控制台。用户可通过 Web 控制台,查看服务器运行状态、统计数据、客户端(Client)、会话(Session)、主题(Topic)、订阅(Subscription)、插件(Plugin)。
控制台地址: http://127.0.0.1:18083,默认用户: admin,密码:public
微信截图_20190406072213.png5、测试emq
下载mqtt客户端测试工具
https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org.eclipse.paho.ui.app/1.0.2/
运行paho客户端
image.png
新建连接,填入emq的ip地址;
publish主题和接受都正常。
后续补充上集群方式。
全文完。
网友评论