yum -y install git libc-ares2-dev uuid-dev
wget http://mosquitto.org/files/source/mosquitto-1.4.10.tar.gz
tar -zxvf mosquitto-1.4.10.tar.gz
cd mosquitto-1.4.10
yum -y install c-ares-devel
yum -y install openssl-devel
yum -y install libuuid-devel
make &make install
mosquitto -c mosquitto.conf -d
ln -s /usr/local/lib/libmosquitto.so.1 /usr/lib/libmosquitto.so.1
mosquitto_sub -t /test
mosquitto_pub -t /test -m 'hello mqtt'
转载于:https://my.oschina.net/jingdor/blog/759527