无法使用 influxdb 2.0 和 docker-compose 正确安装 Grafana

问题描述 投票:0回答:0

Grafana 安装正确。用户界面工作正常,但我无法将它连接到 influxdb 存储桶。你能帮我吗?这是 docker_compose.yml 文件。那个文件有问题吗?我尝试了很多东西,但没有一个效果很好

version: '3.9'

services:
  influxdb:
    image: influxdb:2.6.1
    container_name: influxdb
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=wd9598%%DD
      - DOCKER_INFLUXDB_INIT_ORG=day_trading_organization
      - DOCKER_INFLUXDB_INIT_BUCKET=day_trading_bucket
      - DOCKER_INFLUXDB_INIT_TOKEN=21bc9ec3d7187f0087b4d5ae329afce4cfea8cdb27a0cd516a92efead753217d
    ports:
      - "8086:8086"
    networks:
      - influxdb_network
    volumes:
      - influxdb_storage:/var/lib/influxdb

  grafana:
    image: grafana/grafana:latest
    container_name: grafana_server
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=wd9598%%DD
    ports:
      - "3000:3000"
    depends_on:
      - influxdb
    networks:
      - influxdb_network
    volumes:
      - grafana_storage:/var/lib/grafana

volumes:
  influxdb_storage:
  grafana_storage:

networks:
  influxdb_network:
docker docker-compose grafana influxdb
© www.soinside.com 2019 - 2024. All rights reserved.