Telegraf output to 2x Influxdb2

Hi all,

I seem to have run into a bit of an issue,
I have 2 influxdb2.7 with each being on their own virtual server. I have had some issues on the one
and decided to implement a telegraf instance to try monitor/catch and investigate why it runs away
with memory seemingly out of the blue. the Journctl doesnt have anything significant to report either
when it happens.

Back to the matter at hand. Historian A is new fresh install and is currently getting telegraf data from
himself and Historian B. But Id read it was possible to actually write out to 2 separate Influxdb2 at the
same time. So id like for Historian B to also get the telegraf ouput from itself and Historian A. I found an
example of the address section looking like this
urls = ["“http://124.124.124.53:8086"” ,“http://124.124.124.54:8086”]. But not anything about how to
sort out the tokens as i dont know how to either give the same token for a “user” from one DB to another.
or to have both tokens in the telegraf configuration section. I have tried some combination’s in the token
section but to no avail.

Any help would be really appreciated.

you can but that’s not how it works…

What you used works only for clusters

 ## Multiple URLs can be specified for a single cluster, only ONE of the
 ## urls will be written to each interval.
 urls = ["__ClusterNode1__","__ClusterNodeN__"]

if you want a Telegraf instance to write to multiple databases just add another instance of the output plugin

[[outputs.influxdb_v2]]
  urls = ["__YourServer1__"]
  ...

[[outputs.influxdb_v2]]
  urls = ["__YourServer2__"]
  ...
2 Likes

ohhhh okay that explains some stuff,
It seemed really cool that it would just work if i applied the same concept to the tokens.

Thats awesome and thankyou for the quick response. will try it out tonight
how do i mark this as a good answer and close the topic?

1 Like