I’m trying to install Grafana with InfluxDB on an Amazon EC2 instance.
I’ve done it multiple times without problems, but now I can’t figure out what is wrong.
On my EC2 innstance, I’m running both grafana-server 9.1.6 and influxDB 1.8.10 on localhost (127.0.0.1), using default ports. I can connect to influxdb using the CLI, and I created a database with a user and a password.
I have also a HAProxy acting as a SSL proxy for connections coming from the outside, and I can reach Grafana.
… So far so good.
But when I try to add a datasource, I get “error connecting influxDB influxQL”
hello,
i think you should install a more recent version of influxdb.
is your influxdb instance is running by his own ?
cover this ip adress that i cannot see.
Hi,
Have the same error und connecting issues. I run Grafana and Influx inside docker-compose with treafik and letsencrypt
Here is my compose file:
version: '3'
services:
grafana:
labels:
# SSL redirect requires a separate router (https://github.com/containous/traefik/issues/4688#issuecomment-477800500)
- 'traefik.http.routers.some-name.entryPoints=port80'
- 'traefik.http.routers.some-name.rule=host(`YOUR.DOMAIN.TEST`)'
- 'traefik.http.middlewares.some-name-redirect.redirectScheme.scheme=https'
- 'traefik.http.middlewares.some-name-redirect.redirectScheme.permanent=true'
- 'traefik.http.routers.some-name.middlewares=some-name-redirect'
# SSL endpoint
- 'traefik.http.routers.some-name-ssl.entryPoints=port443'
- 'traefik.http.routers.some-name-ssl.rule=host(`YOUR.DOMAIN.TEST`)'
- 'traefik.http.routers.some-name-ssl.tls=true'
- 'traefik.http.routers.some-name-ssl.tls.certResolver=le-ssl'
- 'traefik.http.routers.some-name-ssl.service=some-name-ssl'
- 'traefik.http.services.some-name-ssl.loadBalancer.server.port=3000'
image: grafana/grafana:9.2.0 # or probably any other version
volumes:
- grafana-data:/var/lib/grafana
environment:
- GF_SERVER_ROOT_URL=https://YOUR.DOMAIN.TEST
- GF_SERVER_DOMAIN=YOUR.DOMAIN.TEST
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SECURITY_ADMIN_USER=SECURE_USERNAME
- GF_SECURITY_ADMIN_PASSWORD=SECURE_PASS
traefik:
image: traefik:v2.9.1
ports:
- '80:80'
- '443:443'
# expose port below only if you need access to the Traefik API
#- "8080:8080"
command:
#- "--log.level=DEBUG"
#- "--api=true"
- '--providers.docker=true'
- '--entryPoints.port443.address=:443'
- '--entryPoints.port80.address=:80'
- '--certificatesResolvers.le-ssl.acme.tlsChallenge=true'
- '--certificatesResolvers.le-ssl.acme.email=YOUR_EMAIL_ADDRESS'
- '--certificatesResolvers.le-ssl.acme.storage=/letsencrypt/acme.json'
volumes:
- traefik-data:/letsencrypt/
- /var/run/docker.sock:/var/run/docker.sock
influx:
image: influxdb:1.8 # or any other recent version
labels:
# SSL endpoint
- 'traefik.http.routers.some-name-influx-ssl.entryPoints=port8086'
- 'traefik.http.routers.some-name-influx-ssl.rule=host(`YOUR.DOMAIN.TEST`)'
- 'traefik.http.routers.some-name-influx-ssl.tls=true'
- 'traefik.http.routers.some-name-influx-ssl.tls.certResolver=le-ssl'
- 'traefik.http.routers.some-name-influx-ssl.service=some-name-influx-ssl'
- 'traefik.http.services.some-name-influx-ssl.loadBalancer.server.port=8086'
restart: always
volumes:
- influx-data:/var/lib/influxdb
environment:
- INFLUXDB_DB=SOME_DB_NAME # set any other to create database on initialization
- INFLUXDB_HTTP_ENABLED=true
- INFLUXDB_HTTP_AUTH_ENABLED=true
- INFLUXDB_ADMIN_USER=SECURE_USERNAME
- INFLUXDB_ADMIN_PASSWORD=SECURE_PASS
volumes:
traefik-data:
grafana-data:
influx-data:
I tried several options in the Grafana InfluxQL data sources and got exactly the same errors as @wimdehul with all of them. Even downgraded to Grafana 9.1.8 save problems.
Logging into the influx container and starting the influx cmd works fine. Only with the command “show databases” I had to enter the command “auth” before and enter my credentials from the docker-compose Influx section. That worked. I also tried with http and https in the Grafana URL. With localhost or docker-compose servicename (influx) but also with the container IP address. All did not work unfortunately.