- Install services
- Install grafana
- Install InfluxDB
- Install mosquitto
- Run services
- mosquitto
- 运行influxdb
- 运行grafana
- 构建应用
$ sudo docker pull grafana/grafanaInstall InfluxDB
$ sudo docker pull influxdbInstall mosquitto
$ sudo docker pull eclipse-mosquittoRun services mosquitto
- 运行mosquitto容器
$ sudo docker run -d --name mqtt -p 1883:1883 -p 9002:9001 -v /home/ubuntu/hugh/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf -v /mosquitto/data -v /mosquitto/log eclipse-mosquitto
- 设置用户名和密码
- 进入容器
$ sudo docker exec -it mqtt sh # /mosquitto # touch pwfile # /mosquitto # chmod 0777 pwfile # mosquitto_passwd -b /mosquitto/pwfile hugh 123456 # exit
- 配置mosquitto.conf
# listener port-number [ip address/host name] listener 1883 allow_anonymous false password_file /mosquitto/pwfile
listener 1883, 必须加,否则如下错误
Starting in local only mode. Connections will only be possible from clients running on this machine.
- 重启容器
$ sudo docker restart d0b2e4122e51
- 测试mosquitto
这里使用的mqtt测试工具为chrome插件mqttbox
- mqtt配置
- 测试
至此mqtt安装结束
$ sudo docker run -d --name influxdb1 -p 8083:8083 -p 8086:8086 influxdb:1.8.10
最新的版本很难用, 还是用1.8.10的版本.
运行grafana$ docker run -d --name=grafana -p 3000:3000 grafana/grafana构建应用



