其他分享
首页 > 其他分享> > Grafana + InfluxDB + Mosquitto

Grafana + InfluxDB + Mosquitto

作者:互联网

这里写自定义目录标题

Install services

Install grafana

$ sudo docker pull grafana/grafana

Install InfluxDB

$  sudo docker pull influxdb

Install mosquitto

$ sudo docker pull eclipse-mosquitto

Run services

mosquitto

  1. 运行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
  1. 设置用户名和密码
$ sudo docker exec -it mqtt sh
# /mosquitto # touch pwfile
# /mosquitto # chmod 0777 pwfile
# mosquitto_passwd -b /mosquitto/pwfile hugh 123456
# exit
# 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
  1. 测试mosquitto
    这里使用的mqtt测试工具为chrome插件mqttbox

运行influxdb

$ 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

构建应用

在这里插入图片描述

标签:sudo,InfluxDB,grafana,mqtt,mosquitto,Install,Mosquitto,docker,Grafana
来源: https://blog.csdn.net/rosemary512/article/details/121572559