Hi. I have 3 databases, each of them have its own retention policy:
> show databases
name: databases
name
----
_internal
COLLECTOR-1
COLLECTOR-3
COLLECTOR-6
Also, every database has one specified user to write on it.
> show grants for DATAIN
database privilege
-------- ---------
COLLECTOR-1 WRITE
> show grants for DATAIN3
database privilege
-------- ---------
COLLECTOR-3 WRITE
> show grants for DATAIN6
database privilege
-------- ---------
COLLECTOR-6 WRITE
I commented all the [[output.influxdb]] in /etc/telegraf/telegraf.conf because I wanted that every metric collector in /etc/telegraf/telegraf.d/ has its own database output. For example:
[[outputs.influxdb]]
urls = ["http://localhost:8086"]
database = "COLLECTOR-1"
database_tag = "COLLECTOR-1"
exclude_database_tag = false
# skip_database_creation = true
# Retention policy commented to avoid errors in influxd logs.
# retention_policy = "30-days-retention"
timeout = "0s"
# # HTTP Basic Auth
username = "DATAIN"
password = "LALALALA"
This is working fine, the Telegraf doesn’t report errors.The problem is that all the metrics are writing in the 3 databases at the same time.
I think it’s a Telegraf issue because I have Windows servers sending metrics to COLLECTOR-1 database and those metrics are not storing in COLLECTOR-3 or -6, which is fine, it’s the way should be.
I was changing the users permissions and every test resulted as expected. The problem is when the service Telegraf starts. I don’t know what else to check. Any idea?