InfluxDB
构建Dockerfile
vim /opt/influxdb-docker/Dockerfile
FROM influxdb COPY influxdb.conf /etc/influxdb/influxdb.conf EXPOSE 8086
vim /opt/influxdb-docker/docker-compose.yml
version: '3.4' services: influxdb: image: influxdb1:latest container_name: influxdb1 build: context: . dockerfile: Dockerfile volumes: - ./influxdb.conf:/etc/influxdb/influxdb.conf - /var/lib/influxdb:/var/lib/influxdb - /etc/localtime:/etc/localtime:ro ports: - 8086:8086 restart: unless-stopped
cd /opt/influxdb-docker
docker-compose build
docker-compose up -d
docker-compose down
docker-compose restart
Test whether the installation is successful
Interface access
curl -G HTTP: // localhost: 8086 / Query --data-urlencode "q = Show Databases"
Docker Exec -it influxdb1 / bin / bash
Influx
Show the Users
The default user name and password do not need to create an administrator
CREATE USER "root" WITH PASSWORD ' root' WITH ALL PRIVILEGES
If you have questions, docker copy the configuration file to view docker cp influxdb1: /etc/influxdb/influxdb.conf / opt
telegraph
Docker-compose wait-for-it.sh for downloading the dependent influxdb
https://github.com/vishnubob/wait-for-it
into / opt / telegraf-docker / li
https://github.com/vishnubob /wait-for-it/blob/master/wait-for-it.sh copy the script
to fill vim /opt/telegraf-docker/wait-for-it.sh
构建Dockerfile
vim /opt/telegraf-docker/Dockerfile
FROM telegraf COPY telegraf.conf /etc/telegraf/telegraf.conf COPY ./wait-for-it.sh /opt/wait-for-it.sh RUN chmod 777 /opt/wait-for-it.sh
vim /opt/telegraf-docker/docker-compose.yml
version: '3.4' services: telegraf: image: telegraf1:latest container_name: telegraf1 build: context: . dockerfile: Dockerfile #command: ["/opt/wait-for-it.sh", "192.168.1.102:8086", "--", "python", "app.py"] volumes: - ./telegraf.conf:/etc/telegraf/telegraf.conf - ./wait-for-it.sh:/etc/wait-for-it.sh - /etc/localtime:/etc/localtime:ro restart: always
cd /opt/telegraf-docker
docker-compose build
docker-compose up -d
docker-compose up -d --build
View telegraf1 container logging nearly 30 minutes
docker logs --since 30m telegraf1
chronograph
构建Dockerfile
mkdir /opt/chronograf-docker
vim /opt/chronograf-docker/Dockerfile
FROM chronograf EXPOSE 8888
mkdir -p /var/lib/chronograf;chown 472:472 /var/lib/chronograf
vim /opt/chronograf-docker/docker-compose.yml
version: '3.4' services: grafana: image: chronograf1:latest container_name: chronograf1 build: context: . dockerfile: Dockerfile ports: - 8085:8888 volumes: - /var/lib/chronograf:/var/lib/chronograf - /etc/localtime:/etc/localtime:ro restart: unless-stopped
cd /opt/chronograf-docker
docker-compose build
docker-compose up -d
Grafana
构建Dockerfile
mkdir / opt / grafana-Docker
vim / opt / grafana-Docker / Dockerfile
FROM grafana / grafana exposé 8086
mkdir -p / var / lib / grafana; Chown 472: 472 / var / lib / grafana
vim /opt/grafana-docker/docker-compose.yml
version: '3.4' services: grafana: image: grafana1:latest container_name: grafana1 build: context: . dockerfile: Dockerfile ports: - 3000:3000 volumes: - /var/lib/grafana:/var/lib/grafana - /etc/localtime:/etc/localtime:ro restart: unless-stopped
cd /opt/grafana-docker
docker-compose build
docker-compose up -d
Enter the site username and password are admin
The first step to create the DataSource
the Name is telegraf above telegraf database name the same configuration
influxdb opened the auth-enabled = true
need to check Basic Auth database username and password are root
Behind the dashboard casual, remember to select tables and columns in the sql statement, some of the columns can press * to display, or will not show data