Hi Team,
I have installed two containers(influxdb and grafana).
Two containers up and running. Able to access grafana(http://grafana.staged-by-discourse.com/datasources/edit/1/) and influxdb(http://localhost:8086/query?q=show%20databases) urls from browser.
But when we configure influxdb in grafana, grafana api throwing 502: Bad Gateway.
Grafana log message
t=2020-12-23T23:53:36+0000 lvl=eror msg="Data proxy error" logger=data-proxy-log userId=1 orgId=1 uname=admin path=/api/datasources/proxy/1/query remote_addr=xxx.xx.x.x referer=http://grafana.staged-by-discourse.com/datasources/edit/1/ error="http: proxy error: dial tcp localhost:8086: connect: connection refused"
t=2020-12-23T23:53:36+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/query status=502 remote_addr=1xxx.xx.x.x time_ms=26 size=0 referer=http://grafana.staged-by-discourse.com/datasources/edit/1/
Docker Compose file:
version: “2”
services:
grafana:
image: grafana/grafana
container_name: grafana
restart: always
ports:
- 3000:3000
volumes:
- grafana_storage:/var/lib/grafana_storage
networks:
- ranga_docker_network
influxdb:
image: influxdb
container_name: influxdb
restart: always
ports:
- 8086:8086
volumes:
- influxdb_storage:/var/lib/influxdb_storage
networks:
- ranga_docker_network
environment:
- INFLUXDB_DB=telegraf
- INFLUXDB_USER=telegraf
- INFLUXDB_ADMIN_ENABLED=true
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=telegraf1234
networks:
ranga_docker_network:
volumes:
grafana_storage:
influxdb_storage:
Thanks,
Ranga Rao