linux mqtt 安装配置
安装
sudo apt install mosquitto
配置密码用户
sudo mkdir -p /etc/mosquitto/config
sudo touch /etc/mosquitto/config/pwfile.conf
sudo mosquitto_passwd -b /etc/mosquitto/config/pwfile.conf qq 123456
配置文件
qtimes@AIBox-01-01-m:~$ cat /etc/mosquitto/mosquitto.conf
pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
listener 1883
protocol mqtt
listener 9001
protocol websockets
allow_anonymous false
password_file /etc/mosquitto/config/pwfile.conf
重启服务
sudo systemctl restart mosquitto
sudo service mosquitto status
*使用mqtt
*使用ws