Grafana unable to connect to native (non-Docker) InfluxDB on localhost - Network Error: Bad Gateway(502)


I’m using Ubuntu 18.10 with InfluxDB 1.7.4.

I’ve installed Grafana 6.0.0-beta3 as per the installation instructions:

echo "deb beta main" >> /etc/apt/sources.list.d/grafana.list
curl | sudo apt-key add -
sudo apt update
sudo apt install grafana
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
sudo /bin/systemctl start grafana-serve

I’m then trying to add InfluxDB on localhost as a data-source in Grafana.

However, it keeps giving me Network Error: Bad Gateway(502).

I can confirm I’m able to curl http://localhost:8006/ping from the host itself. It’s all running natively (i.e. not containers) on the same host, so not sure what’s going on here?

Any ideas what’s going on?


You’ll want to use port 8086 to connect to influxdb. Here’s a screenshot of an influxdb datasource I use: