1.消息队列emqtt
Posted forlive
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了1.消息队列emqtt相关的知识,希望对你有一定的参考价值。
2.x版本之前都叫emqtt,3.x之后版本都叫emqx
下载地址:https://www.emqx.io/cn/downloads#broker
安装部署
1.下载软件包后上传到服务器,解压
unzip emqttd-centos7-v2.0.zip
2.以调试模式启动,检查服务是否正常
[root@localhost emqttd]# cd emqttd && ./bin/emqttd console Exec: /root/emqttd/erts-9.0/bin/erlexec -boot /root/emqttd/releases/2.3.7/emqttd -mode embedded -boot_var ERTS_LIB_DIR /root/emqttd/erts-9.0/../lib -mnesia dir "/root/emqttd/data/mnesia/emq@127.0.0.1" -config /root/emqttd/data/configs/app.2020.05.23.23.38.19.config -args_file /root/emqttd/data/configs/vm.2020.05.23.23.38.19.args -vm_args /root/emqttd/data/configs/vm.2020.05.23.23.38.19.args -- console Root: /root/emqttd /root/emqttd Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:32] [hipe] [kernel-poll:true] starting emqttd on node ‘emq@127.0.0.1‘ emqttd ctl is starting...[ok] emqttd hook is starting...[ok] emqttd router is starting...[ok] emqttd pubsub is starting...[ok] emqttd stats is starting...[ok] emqttd metrics is starting...[ok] emqttd pooler is starting...[ok] emqttd trace is starting...[ok] emqttd client manager is starting...[ok] emqttd session manager is starting...[ok] emqttd session supervisor is starting...[ok] emqttd wsclient supervisor is starting...[ok] 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.7 is running now Eshell V9.0 (abort with ^G) (emq@127.0.0.1)1> Load emq_mod_presence module successfully. dashboard:http listen on 0.0.0.0:18083 with 4 acceptors. mqtt:tcp listen on 127.0.0.1:11883 with 4 acceptors. mqtt:tcp listen on 0.0.0.0:1883 with 16 acceptors. mqtt:ws listen on 0.0.0.0:8083 with 4 acceptors. mqtt:ssl listen on 0.0.0.0:8883 with 16 acceptors. mqtt:wss listen on 0.0.0.0:8084 with 4 acceptors. mqtt:api listen on 0.0.0.0:8080 with 4 acceptors.
3.查看服务启动状态
[root@localhost ~]# ./emqttd/bin/emqttd_ctl status Node ‘emq@127.0.0.1‘ is started emqttd 2.3.7 is running
4.如果服务启动正常,更改为后台启动,启动错误日志将输出到log目录下
./bin/emqttd start
5.EMQ 消息服务器提供了状态监控 URL
http://localhost:8080/status
6.控制台 URL: http://localhost:18083/ ,默认登录用户名: admin, 密码: public。
7.停止服务器:
./bin/emqttd stop
调试配置
1.EMQ 2.0 消息服务器默认占用的 TCP 端口包括:
1883 | MQTT 协议端口 |
8883 | MQTT/SSL 端口 |
8083 | MQTT/WebSocket 端口 |
8080 | HTTP API 端口 |
18083 | Dashboard 管理控制台端口 |
2.可通过 etc/emq.conf 配置文件的 ‘listener’ 段落设置(18083是由emq_dashboard插件控制,配置文件在etc/plugins/emq_dashboard.conf)
## TCP Listener: 1883, 127.0.0.1:1883, ::1:1883 listener.tcp.external = 0.0.0.0:1883 ## SSL Listener: 8883, 127.0.0.1:8883, ::1:8883 listener.ssl.external = 8883 ## External MQTT/WebSocket Listener listener.ws.external = 8083 ## HTTP Management API Listener listener.api.mgmt = 127.0.0.1:8080
3.EMQ 消息服务器主要配置文件:
etc/emq.conf | EMQ 消息服务器参数设置 |
etc/plugins/*.conf | EMQ 插件配置文件 |
4.
以上是关于1.消息队列emqtt的主要内容,如果未能解决你的问题,请参考以下文章