MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,有可能成为物联网的重要组成部分。
首先创建实例
docker run -ti -h mqtt --name mqtt_1884 -p 21884:1884 ubuntu:14.04
然后更新
apt-get update
apt-get install libc-ares-dev uuid-dev wget make libssl-dev g++
wget http://mosquitto.org/files/source/mosquitto-1.4.14.tar.gz
tar zxfv mosquitto-1.4.14.tar.gz
cd mosquitto-1.4.14
make
make install
然后添加用户
adduser mosquitto
cp /etc/mosquitto/mosquitto.conf.example /etc/mosquitto/mosquitto.conf
vi /etc/mosquitto/mosquitto.conf
去掉端口的注释,改为1884
mosquitto -v -c /etc/mosquitto/mosquitto.conf