centos7 安装mosquitto

yum -y install mosquitto
touch /etc/mosquitto/pwfile
mosquitto_passwd /etc/mosquitto/pwfile admin
mkdir /etc/mosquitto/logs
chown -R mosquitto.mosquitto logs/
mosquitto -c /etc/mosquitto/mosquitto.conf -v -d
[root@pctest ~]# cat /etc/mosquitto/mosquitto.conf 
# Config file for mosquitto

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /etc/mosquitto/logs/mosquitto.log

#include_dir /etc/mosquitto/conf.d
allow_anonymous false
password_file /etc/mosquitto/pwfile
listener 1883
#

你可能感兴趣的:(centos7 安装mosquitto)