当前位置:网站首页>物联网开发--MQTT消息服务器EMQX
物联网开发--MQTT消息服务器EMQX
2022-07-29 01:21:00 【CK持续成长】
目录
EMQX官方介绍
EMQX是一款完全开源,高度可伸缩,高可用的分布式 MQTT 消息服务器,可处理千万级别的并发客户端。EMQX 完整支持 MQTT V5.0 协议规范,向下兼容 MQTT V3.1 和 V3.1.1。
我们首先需要去安装一个EMQX的消息服务。这里我们使用环境:
操作系统:ubuntu 18.04
EMQX使用版本:v5.0.3
1. 安装EMQX
安装EMQX有几种方式,1:docker镜像安装,2: 直接下载官方二进制包,3:下载源码进行编译安装
1.1 docker镜像安装
- 获取docker镜像
//获取 Docker 镜像 docker pull emqx/emqx - 启动docker容器
docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx - 访问EMQX的dashboard
http://192.168.1.181:18083/#/login说明:EMQX的Dashboard的登录的默认账号/密码: admin/public。 默认账号密码配置在/e tc/emqx/emqx.conf中
1.2 ubuntu的apt源安装
- 配置EMQX的APT源
curl -s https://assets.emqx.com/scripts/install-emqx-deb.sh | sudo bash - 使用APT安装EMQX
sudo apt-get install emqx - 启动EMQX
sudo emqx start启动成功后可以使用
emqx ping命令检测节点运行状态,返回pong则表示正常运行:
sudo emqx ping或者以服务启动:
sudo systemctl start emqx- 访问EMQX
http://192.168.1.181:18083/#/login
1.3 拉取源码进行安装
注:构建 EMQX 需要 Erlang/OTP R21+。
- 1.从git拉取源码
git clone https://github.com/emqx/emqx.git - 2. 切换到v5.0.3的版本
cd emqx git checkout v5.0.3 - 3. 编译源码
编译好后有emqx和emqx_ctl两个二进制文件make
2. mqtt客户端使用
EMQX安装完成后,我们安装一个桌面版的客户端来实际验证一下,mqtt客户端有很多,比如MQTT.fx, MQTT Box等,这里我们使用EMQX官方提供的mqtt客户端MQTT X。
下载地址:免费下载、试用 EMQ 产品
2.1 安装好Mqtt X的客户端后,配置mqtt的链接

点击右上角的"Connect", 提示连接成功后,进入EMQX的Dashboard界面,查看是否已经有连接记录

2.2 在mqtt x客户端添加订阅一个topic, 名为“/iot/device/msg/push”

2.3 添加完订阅的topic之后,我们在界面下方发送一条消息到上面的topic

我们看到中间的区域有我们发送的消息和接受到的订阅消息
3. 参考资料
emqx社区开源版:下载 EMQX
github地址:GitHub - emqx/emqx: The most scalable open-source MQTT broker for IoT
边栏推荐
- Planning mathematics final simulation exam I
- The growth path of embedded engineers
- Explanation of yocto project directory structure
- Stonedb invites you to participate in the open source community monthly meeting!
- [MySQL] SQL aliases the table
- Tda75610-i2c-determination of I2C address of analog power amplifier
- leetcode/0和1个数相同的连续子数组
- The solution of reducing the sharpness of pictures after inserting into word documents
- Wonderful use of data analysis
- Mathematical modeling -- Optimization of picking in warehouse
猜你喜欢

【流放之路-第四章】
![[the road of Exile - Chapter III]](/img/f8/3d1dfabaacf030450c1576fe543cfa.png)
[the road of Exile - Chapter III]

Know that Chuangyu is listed in many fields of ccsip 2022 panorama

数学建模——自来水管道铺设问题

Day01作业

数学建模——红酒品质分类
![[the road of Exile - Chapter 5]](/img/ef/7ecc1cb4a95c613f7be91f7acc761c.png)
[the road of Exile - Chapter 5]

Using local cache + global cache to realize user rights management of small systems

(arxiv-2018) 重新审视基于视频的 Person ReID 的时间建模

Data platform data access practice
随机推荐
Promise解决异步
[the road of Exile - Chapter 5]
Web crawler API Quick Start Guide
Thirty years of MPEG audio coding
Sigma-DSP-OUTPUT
JS dom2 and dom3
Monadic linear function perceptron: Rosenblatt perceptron
Planning mathematics final exam simulation II
Use of packet capturing tool Charles
【10点公开课】:快手GPU/FPGA/ASIC异构平台的应用探索
ciscn 2022 华中赛区 misc
The scientific research environment has a great impact on people
Qt 内存管理小技巧
秘术冬潮烙技能搭配
Tda75610-i2c-determination of I2C address of analog power amplifier
The number of consecutive subarrays whose leetcode/ product is less than k
试着换个角度理解低代码平台设计的本质
E-commerce keyword research helps data collection
Anti crawler mechanism solution: JS code generates random strings locally
Process -- user address space and kernel address space