docker-composegrafanainfluxdbbad-gateway

DockerCompose-Grafana-InfluxDB-Error: Bad Gateway


I know there are some similar questions in the forum, but nothing worked really out. I try to connect grafana and influxdb with a dockercompose File, but everytime i get a Bad Gateway error. Here is the file:

services:
  grafana:
    image: grafana/grafana
    container_name: grafana
    restart: always
    ports:
      - 3000:3000
    networks:
      - grafana_network
    volumes:
      - grafana_data:/var/lib/grafana
    depends_on:
      - influxdb


  influxdb:
    image: influxdb:latest
    container_name: influxdb
    restart: always
    ports:
      - 8086:8086
    networks:
      - grafana_network
    volumes:
      - influxdb_data:/var/lib/influxdb
    environment:
      - INFLUXDB_DB=grafana
      - INFLUXDB_USER=grafana
      - INFLUXDB_USER_PASSWORD=password
      - INFLUXDB_ADMIN_ENABLED=true
      - INFLUXDB_ADMIN_USER=admin 
      - INFLUXDB_ADMIN_PASSWORD=password 
networks:
  grafana_network:
volumes:
  grafana_data:
  influxdb_data:

Bad Gateway Error

I already changed influxdb to localhost or ipaddress, nothing helped Only the Error changed to Bad Request.. Any recommendations?

Big Thanks!


Solution

  • Had the same problem.

    Selecting the Query Language Flux instead of InfluxQL worked for me.

    Don't forget to use the URL http://influxdb:8086 as this is the name of your InfluxDB-service within docker compose.