双写到 InfluxDB OSS 和 InfluxDB Clustered
如果您想在两个位置备份数据,或者您正在从 InfluxDB OSS 迁移到 InfluxDB Clustered,您可能需要设置 Telegraf 进行双写。
使用 Telegraf 同时写入 InfluxDB OSS 和 InfluxDB Clustered。
以下示例配置使用
- InfluxDB v2 输出插件 两次:第一次指向 OSS 实例,然后指向 InfluxDB 集群。
- 两个不同的令牌,一个用于 OSS,一个用于 Clustered。您需要将这两个令牌配置为环境变量(请参阅如何将身份验证凭据配置为环境变量)。
使用以下配置将您的数据同时写入 OSS 和 Clustered 实例。
示例配置
# Include any other input, processor, or aggregator plugins 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 = ["https://#: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 = "ORG_NAME_OSS"
## Destination bucket to write to.
bucket = "BUCKET_NAME_OSS"
# Send data to InfluxDB cluster
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB instance.
urls = ["https://cluster-host.com"]
## Cloud token for authentication.
token = "${INFLUX_TOKEN}"
## For InfluxDB Clustered, set organization to an empty string.
organization = ""
## Destination bucket to write into.
bucket = "DATABASE_NAME"
此页内容对您有帮助吗?
感谢您的反馈!
支持与反馈
感谢您成为我们社区的一份子!我们欢迎并鼓励您提供关于 InfluxDB Clustered 和本文档的反馈和错误报告。如需查找支持,请使用以下资源
拥有年度或支持合同的客户可以联系 InfluxData 支持。