Hi everyone, I am trying to connect to Influxdb 2 but getting connection refused each time.
This is my docker compose I am using to create InfluxDB container:-
influxdb: image: influxdb:alpine volumes: - influxdb-data:/var/lib/influxdb ports: - "8086:8086" environment: DOCKER_INFLUXDB_INIT_MODE: setup DOCKER_INFLUXDB_DB: openwisp2 DOCKER_INFLUXDB_INIT_USERNAME: openwisp DOCKER_INFLUXDB_INIT_PASSWORD: openwisp DOCKER_INFLUXDB_INIT_ORG: openwisp DOCKER_INFLUXDB_INIT_BUCKET: openwisp-bucket DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: "openwisp-secret"
For querying I am using influxdb-client(python library) and querying in a way:
INFLUXDBClient(url="
http://localhost:8086
",token="openwisp-secret", org="openwisp").query_api().query(Query I wanna execute)