双写到 InfluxDB OSS 和 InfluxDB Cloud
如果您想在两个位置备份数据,或者您正在从 OSS 迁移到 Cloud,您可能需要设置双写。
使用 Telegraf 同时写入 InfluxDB OSS 和 InfluxDB Cloud。
以下示例配置使用
- 两次使用 InfluxDB v2 输出插件:第一次指向 OSS 实例,然后指向 Cloud 实例。
- 两个不同的令牌,一个用于 OSS,一个用于 Cloud。 您需要将两个令牌都配置为环境变量(请参阅将您的令牌配置为环境变量)。
使用以下配置同时将数据写入 OSS 和 Cloud 实例。
示例配置
[[inputs.cpu]]
[[inputs.mem]]
## Any other inputs, processors, aggregators that you want to include in your configuration.
# Send data to InfluxDB OSS v2
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB instance.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
## urls exp: http://127.0.0.1:9999
urls = ["http://localhost:8086"]
## OSS token for authentication.
token = "$INFLUX_TOKEN_OSS"
## Organization is the name of the organization you want to write to. It must already exist.
organization = "influxdata"
## Destination bucket to write to.
bucket = "telegraf"
# Send data to InfluxDB Cloud - AWS West cloud instance
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB Cloud instance.
urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
## Cloud token for authentication.
token = "$INFLUX_TOKEN_CLOUD"
## Organization is the name of the organization you want to write to. It must already exist.
organization = "example@domain.com"
## Destination bucket to write into.
bucket = "telegraf"
此页面是否对您有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一份子! 我们欢迎并鼓励您提供关于 InfluxDB 和本文档的反馈和错误报告。 要寻求支持,请使用以下资源
拥有年度合同或支持合同的客户可以联系 InfluxData 支持。