Dual write to OSS and Cloud (#3383)
* Create dual write scenario doc * Add cloud version of dual write * Anonymize email address * Move piece into config * Added details about two tokens * Update content/influxdb/cloud/write-data/no-code/use-telegraf/dual-write.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update content/influxdb/v2.1/write-data/no-code/use-telegraf/dual-write.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update content/influxdb/v2.1/write-data/no-code/use-telegraf/dual-write.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update content/influxdb/v2.1/write-data/no-code/use-telegraf/dual-write.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update content/influxdb/v2.1/write-data/no-code/use-telegraf/dual-write.md Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> * Update data/telegraf_plugins.yml Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> * Replace instructions in migration doc with link to new doc * Fix spelling * Address PR feedback * Fix link Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>pull/3404/head
parent
4ad5a80ab4
commit
dc41d5e0b0
|
@ -208,44 +208,7 @@ to your InfluxDB Cloud instance.
|
|||
## Dual write to InfluxDB 2.x and InfluxDB Cloud
|
||||
Update external clients to write to your InfluxDB Cloud instance.
|
||||
**We recommend writing data to both InfluxDB 2.x and InfluxDB Cloud until you
|
||||
finish [migrating your existing time series data](#migrate-time-series-data)**.
|
||||
|
||||
Configure external clients with your InfluxDB Cloud **host**, **organization**,
|
||||
and **API token**.
|
||||
|
||||
### Update Telegraf configurations
|
||||
If using Telegraf configurations migrated to or stored in InfluxDB Cloud,
|
||||
[update your Telegraf configurations](/influxdb/cloud/telegraf-configs/update/)
|
||||
**in InfluxDB Cloud** to write to both InfluxDB 2.x and InfluxDB Cloud:
|
||||
|
||||
1. [Update your Telegraf configuration](/influxdb/cloud/telegraf-configs/update/)
|
||||
with a second `influxdb_v2` output to write to your InfluxDB Cloud instance.
|
||||
|
||||
##### Example dual-write Telegraf configuration
|
||||
```toml
|
||||
# Write metrics to InfluxDB 2.x
|
||||
[[outputs.influxdb_v2]]
|
||||
urls = ["https://localhost:8086"]
|
||||
token = "$INFLUX_TOKEN"
|
||||
organization = "example-org"
|
||||
bucket = "example-bucket"
|
||||
|
||||
# Write metrics to InfluxDB Cloud
|
||||
[[outputs.influxdb_v2]]
|
||||
urls = ["https://cloud2.influxdata.com"]
|
||||
token = "$INFLUX_CLOUD_TOKEN"
|
||||
organization = "your.email@example.com"
|
||||
bucket = "example-bucket"
|
||||
```
|
||||
|
||||
2. Add the following environment variables to your Telegraf environment(s):
|
||||
|
||||
- `INFLUX_TOKEN`: InfluxDB 2.x API token
|
||||
- `INFLUX_CLOUD_TOKEN`: InfluxDB Cloud API token
|
||||
|
||||
3. Use the command provided in your [Telegraf Setup Instructions](/influxdb/cloud/telegraf-configs/#use-influxdb-telegraf-configurations)
|
||||
to restart Telegraf with the updated configuration and begin writing to both
|
||||
InfluxDB 2.x and InfluxDB Cloud.
|
||||
finish [migrating your existing time series data](#migrate-time-series-data)**. For step-by-step instructions, see [Dual write](/influxdb/cloud/write-data/no-code/use-telegraf/dual-write/).
|
||||
|
||||
## Migrate time series data
|
||||
To migrate your time series data from your InfluxDB 2.x instance to your
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
title: Dual write to InfluxDB OSS and InfluxDB Cloud
|
||||
description: Write data to both OSS and Cloud simultaneously.
|
||||
menu:
|
||||
influxdb_cloud:
|
||||
parent: Telegraf (agent)
|
||||
weight: 201
|
||||
---
|
||||
|
||||
{{< duplicate-oss >}}
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
title: Dual write to InfluxDB OSS and InfluxDB Cloud
|
||||
description: Write data to both OSS and Cloud simultaneously.
|
||||
menu:
|
||||
influxdb_2_1:
|
||||
parent: Telegraf (agent)
|
||||
weight: 201
|
||||
---
|
||||
|
||||
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:
|
||||
- The [InfluxDB v2 output plugin](https://github.com/influxdata/telegraf/tree/master/plugins/outputs/influxdb_v2) twice: first pointing to the OSS instance and then to the cloud instance.
|
||||
- Two different tokens, one for OSS and one for Cloud. You'll need to configure both tokens as environment variables (see [Configure your token as an environment variable](/influxdb/v2.1/write-data/no-code/use-telegraf/auto-config/#configure-your-token-as-an-environment-variable).
|
||||
|
||||
Use the configuration below to write your data to both OSS and Cloud instances simultaneously.
|
||||
|
||||
## Sample configuration
|
||||
|
||||
```
|
||||
[[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"
|
||||
```
|
|
@ -2166,7 +2166,7 @@ output:
|
|||
- name: InfluxDB v2
|
||||
id: influxdb_v2
|
||||
description: |
|
||||
The InfluxDB v2 output plugin writes metrics to [InfluxDB 2.0](https://github.com/influxdata/influxdb).
|
||||
The InfluxDB v2 output plugin writes metrics to [InfluxDB 2.x](https://github.com/influxdata/influxdb) OSS or Cloud.
|
||||
introduced: 1.8.0
|
||||
tags: [linux, macos, windows, data-stores]
|
||||
|
||||
|
|
Loading…
Reference in New Issue