OlKo
OlKo

Reputation: 23

InfluxDB Error: default retention policy not set for database in grafana after influx update from 1 to 2

I have updated my Influx database and also mapped the databases. But now I get the following problem in Grafana:

What could be the reason? I get the values via Flux without any problems. However, I would like to continue using InfluxQL

Upvotes: 2

Views: 3741

Answers (2)

Gelldur
Gelldur

Reputation: 11558

Docs to refer: https://docs.influxdata.com/influxdb/cloud/query-data/influxql/dbrp/#create-dbrp-mappings

Example:

influx v1 dbrp create --default --bucket-id 520047e21111111 --db telegraf --rp default

I think you may change default to autogen (last parameter). I used default as it is used by Grafana 9? (Not confirmed). You see this in your error message:

InfluxDB Error: default retention policy not set for database

Of course you need create such mapping for each bucket you have.


Maybe you will find it also useful example connection Grafana 9.1 -> Influx 2.4.

enter image description here

See Configure InfluxDB authentication:: https://docs.influxdata.com/influxdb/v2.1/tools/grafana/?t=InfluxQL

In this format you need to pass Authorization header. With space in it!

Token y0uR5uP3rSecr3tT0k3n

You can generate token in Influx web GUI (it will be long and i think Base64 encoded?)

enter image description here

Upvotes: 1

mhall119
mhall119

Reputation: 577

In order to continue using InfluxQL you will need to setup the Database/Retention Policy mapping for your new 2.x buckets, so that InfluxQL can treat them like 1.x databases. Have you done this already?

Upvotes: 1

Related Questions