Get Telegraf to send to multiple InfluxDB hosts



I totally get that I can use Enterprise Influx to solve this issue and understand if that is the only way to get what I want out of the box.

I have two servers that I want to use as influxdb host and I want my servers which are running telegraf daemons to post to both servers. I know that if I setup urls = [“server1”,“server2”] in [[outputs.influxdb]] I get round robin sending not duplicate sending.

Is there anyway short of placing a multiplexer in the path of telegraf to get a single telegraf daemon to send to multiple influx servers.


Yes, you can define multiple outputs:

  urls = ["http://server1:8086"]
  # ... other options ...

  urls = ["http://server2:8086"]
  # ... other options ...


This works great - Thanks very much for the response!


Hello Mr.Daniel
I try as you said.
But I can’t start Telegraf.

I try:

  urls = ["http://server1:8086", "http://server2:8086"]

But Telegraf send metrics to server1 during period. Then Telegraf send metrics to server2 during period. And repeat again.

Please help me to fix it.


Just update your config to use the pattern shown in my comment above, with two independent influxdb outputs.


you need 2 separate output.influxdb definitions that each specify a different host. Not one output.influxdb that specifies 2 hosts.


I try as you said.
But I can’t start Telegraf.


Hi , why can’t you start Telegraf ? Does it give an error ?


I can’t start telegraf. This is log debug.

systemd[1]: telegraf.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: telegraf.service: Unit entered failed state.
systemd[1]: telegraf.service: Failed with result 'exit-code'.
systemd[1]: telegraf.service: Service hold-off time over, scheduling restart.
systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
systemd[1]: telegraf.service: Start request repeated too quickly.
systemd[1]: Failed to start The plugin-driven server agent for reporting metrics into InfluxDB.

Then, I comment and use only 1 output.influxdb. I started it success.


Thanks , can you give the
[[ outputs.influxdb]]
Sections of your configfile?
Is there any logging in the Telegraf logfile ?
Example : /var/log/telegraf/telegraf.log

Can you try to start Telegraf without using systemctl ?
Best regards


Thank you very much ^^
I try do it and success ^^