1.安装工具
#yum install gcc gcc-c++
openssl-devel
c-ares-devel
libuuid-devel
make
2.安装eclipse paho C库
#git clone https://github.com/eclipse/paho.mqtt.c
#cd paho.mqtt.c
#make
#yum install doxygen
#make html
#make install
3.编译安装mosquitto
#wget http://mosquitto.org/files/source/mosquitto-1.4.9.tar.gz
#tar -xzvf mosquitto-1.4.9.tar.gz
#cd mosquitto-1.4.9
#make
#make install
4.修改mosquitto.conf文件
#vi mosquitto.conf
最后加入
user root
Port 1883
5.运行mosquitto
#mosquitto -c ./mosquitto.conf -v