因需要通过网络提供对硬件的可控测试要求,下面详细记录在阿里云ECS上搭建MQTT服务的过程。
目前可使用的MQTT服务端Broker(消息代理)有许多。经查询对比,选择Mosquitto为此次测试的Broker。
其他的Broker及其特点可以前往下面地址详细阅读。
Tips:测试ECS上系统为Debian 12。
1、更新Debian软件仓库
# apt update
2、安装消息代理(broker)服务端软件包,也就是 mosquitto 软件包
# apt install mosquitto
安装完毕后,该软件已自行启动
3、检查 mosquitto