1、执行
apt-get install mosquitto
2、修改配置文件
/etc/mosquitto/mosquitto.conf
listener 1883 0.0.0.0
allow_anonymous true
3、重启
方式1
sudo service mosquitto stop
sudo service mosquitto start
方式2
systemctl restart mosquitto
4、查看运行状态
sudo service mosquitto status
5、查看端口
ss -tanl