同时写入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 = ["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 = "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"
这个页面有帮助吗?
感谢您的反馈!