服务器是Centos,mosquitto版本是1.6.12
mosquitto 是上家公司用的中间件,支持mqttV3协议,标准的物联网mq
mosquitto 下载地址http://mosquitto.org/download/
- 下载mosquitto tar.gz包
- 安装依赖
yum install gcc-c++
yum install cmake
yum install openssl-devel
-
tar -zxvf mosquitto-xxxx
-
cd mosquitto-xxxx
-
make
-
sudo make install
-
修改conf
a. allow_anonymous false
b. password_file
-
在对应路径/data下创建文件
touch mqpwdfile -
为mq增加帐号密码。直接写到这个mqpwdfile没卵用的
mosquitto_passwd -c mqpwdfile 用户名
Password:
重复两次密码
-
-
启动mosquitto
mosquitto -c /data/mosquitto-1.6.12/mosquitto.conf -d
-
ps -ef |grep mosquitto
-
mqtt.fx连接成功