linux中安装EMQ服务器实现MQTT消息传输
下载安装EMQ
链接:https://www.emqx.io/cn/downloads#broker
要选择跟你相关的版本 我是ubuntu18.4
安装方式我选择的deb,直接安装到系统bin中去。
我是直接通过命令安装的,没有下安装包编译
- 下载
wget https://www.emqx.io/cn/downloads/broker/v4.2.2/emqx-ubuntu18.04-4.2.2-x86_64.deb
- 安装
sudo dpkg -i emqx-ubuntu18.04-4.2.2-x86_64.deb
- 启动
sudo emqx start
大家会看到这样的界面
Starting emqx on node emqx@127.0.0.1
Start http:management listener on 8081 successfully.
//网页端口
Start http:dashboard listener on 18083 successfully.
//本机连接mqtt:tcp端口
Start mqtt:tcp listener on 127.0.0.1:11883 successfully.
//所有主机连接的端口
Start mqtt:tcp listener on 0.0.0.0:1883 successfully.
网页套接字连接的端口
Start mqtt:ws listener on 0.0.0.0:8083 successfully.
//安全连接的端口
Start mqtt:ssl listener on 0.0.0.0:8883 successfully.
Start mqtt:wss listener on 0.0.0.0:8084 successfully.
EMQ X Broker 4.1.1 is running now!
- CTRL+C 关闭控制台。守护进程模式启动:
./bin/emqx start
然后通过 ip:18083 就可以访问emq了,如果打不开就说明端口没开放,开放一下就行了。
本文地址:https://blog.csdn.net/qq_45125250/article/details/109272198