docker-compose 安装基于telegraf + influxdb + grafana监控系统

docker-compose 安装基于telegraf + influxdb + grafana监控系统


docker-compose.yml

version: '3.7'

services:
  influxdb:
    image: influxdb
    container_name: influxdb
    restart: always
    environment:
      - PRE_CREATE_DB=telegraf
      - ADMIN_USER="telegraf"
      - INFLUXDB_INIT_PWD="telegraf123"
      - GOGC=10
      - INFLUXDB_DATA_INDEX_VERSION=tsi1
    ports:
      - "8186:8086"
    expose:
      - "8090"
      - "8099"
    volumes:
      - "./influxdb/db:/var/lib/influxdb"
    networks:
      - monitor

  grafana:
    image: grafana/grafana
    container_name: grafana
    restart: always
    ports:
      - "3000:3000"
    environment:
      - HTTP_USER=admin
      - HTTP_PASS=admin
      - INFLUXDB_HOST=influxdb
      - INFLUXDB_PORT=8186
      - INFLUXDB_NAME=telegraf
      - INFLUXDB_USER=root
      - INFLUXDB_PASS=root
    volumes:
      - "./grafana:/var/lib/grafana"
    networks:
      - monitor
    depends_on:
      - "influxdb"

  telegraf:
    image: telegraf
    container_name: telegraf
    restart: always
    volumes:
      - ./telegraf:/etc/telegraf
      - /sys:/rootfs/sys:ro
      - /proc:/rootfs/proc:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      - 'HOST_PROC=/rootfs/proc'
      

你可能感兴趣的:(运维,运维,docker)