Dual write to InfluxDB OSS and InfluxDB Cloud

This page documents an earlier version of InfluxDB. InfluxDB v2.7 is the latest stable version. View this page in the v2.7 documentation.

If you want to back up your data in two places, or if you’re migrating from OSS to Cloud, you may want to set up dual write.

Use Telegraf to write to both InfluxDB OSS and InfluxDB Cloud simultaneously.

The sample configuration below uses:

Use the configuration below to write your data to both OSS and Cloud instances simultaneously.

Sample configuration

  1. [[inputs.cpu]]
  2. [[inputs.mem]]
  3. ## Any other inputs, processors, aggregators that you want to include in your configuration.
  4. # Send data to InfluxDB OSS v2
  5. [[outputs.influxdb_v2]]
  6. ## The URLs of the InfluxDB instance.
  7. ##
  8. ## Multiple URLs can be specified for a single cluster, only ONE of the
  9. ## urls will be written to each interval.
  10. ## urls exp: http://127.0.0.1:9999
  11. urls = ["http://localhost:8086"]
  12. ## OSS token for authentication.
  13. token = "$INFLUX_TOKEN_OSS"
  14. ## Organization is the name of the organization you want to write to. It must already exist.
  15. organization = "influxdata"
  16. ## Destination bucket to write to.
  17. bucket = "telegraf"
  18. # Send data to InfluxDB Cloud - AWS West cloud instance
  19. [[outputs.influxdb_v2]]
  20. ## The URLs of the InfluxDB Cloud instance.
  21. urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
  22. ## Cloud token for authentication.
  23. token = "$INFLUX_TOKEN_CLOUD"
  24. ## Organization is the name of the organization you want to write to. It must already exist.
  25. organization = "example@domain.com"
  26. ## Destination bucket to write into.
  27. bucket = "telegraf"