# Influxdb Database Replication for High Availability

**URL:** <https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365>\
**Category:** Systems\
**Created:** [January 31, 2019, 3:08pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365 "2019-01-31T15:08:44Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [January 31, 2019, 3:08pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/1 "2019-01-31T15:08:44Z")

</div>

we are using Telegraf, Influxdb and Grafana for Monitoring our environment. We have two datacenters dc1 and dc2. Each datacenter has one pod of Influxdb running. we want some approach to replicate the data between two influxdb instances running across two datacenters. So, if dc1 goes down we can have the data of both datacenters(dc1 and dc2) in dc2. We are using opensource Influxdb so can anyone please suggest some approaches to achieve this?

Tried to follow Replication during ingest approach where we configure two influxdb urls of both datacenters in telegraf.conf as per this [Multiple Data Center Replication with InfluxDB | InfluxData](https://www.influxdata.com/blog/multiple-data-center-replication-influxdb/) documentation but, what if one of the influxdb is down? and also after it’s recovery both influxdb instances will have different data so, we do not want to follow this approach.

Note:- We are looking for Opensource Influxdb High avaialability approaches only.

---

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [February 5, 2019, 6:44pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/2 "2019-02-05T18:44:47Z")

</div>

Can anyone please suggest some approaches for InfluxDB replication with Opensource version.

---

<div class="post-metadata">

**Author:** ![rawkode](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rawkode/32/5161_2.png) [@rawkode](https://community.influxdata.com/u/rawkode)\
**Post date:** [February 5, 2019, 6:49pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/3 "2019-02-05T18:49:41Z")

</div>

Hi @harika2724,

Have you seen InfluxDB Replay?

> **[GitHub - influxdata/influxdb-relay: Service to replicate InfluxDB data for...](https://github.com/influxdata/influxdb-relay)**
>
> Service to replicate InfluxDB data for high availability - GitHub - influxdata/influxdb-relay: Service to replicate InfluxDB data for high availability

---

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [February 5, 2019, 6:54pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/4 "2019-02-05T18:54:56Z")

</div>

Hi @rawkode Thanks for the reply.

Yes I have checked that, In our environment currently the data flows from Telegraf -\> Influxdb -\> Grafana. So, I need to change this flow as Telegraf- -\> Influxdb Relay -\> Influxdb -\> Grafana right?

I saw that there are few limitations regarding Influxdb Relay:-

Failure of one Relay or one InfluxDB can be sustained while still taking writes and serving queries. However, the recovery process might require operator intervention. It has also not been updated in 2 years, is not sufficient for long periods of downtime as all data is buffered in RAM, buffered data is lost if a Relay node fails, and when the buffer is full requests are dropped. During prolonged outages the buffer may also negatively impact the health of the Relay instance itself by adding memory pressure. Lastly, a health checker would have to be added to this setup in order to make sure nodes recovering from temporary failures do not respond to queries while the buffer is still being flushed — otherwise only partial data will be delivered, alerts might go off, etc.

Can you please let me know whether this is the only option for Influxdb replication in Opensource version, or do we have any other alternatives to this?

---

<div class="post-metadata">

**Author:** ![rawkode](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rawkode/32/5161_2.png) [@rawkode](https://community.influxdata.com/u/rawkode)\
**Post date:** [February 5, 2019, 7:00pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/5 "2019-02-05T19:00:38Z")

</div>

You could also have telegraf write to multiple InfluxDB’s by configuring multiple outputs.

---

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [February 5, 2019, 7:15pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/6 "2019-02-05T19:15:36Z")

</div>

Yes I tried that approach for this, we need to change the telegraf.conf file with two outputs containing the url’s of two influxdb instances of two datacenters. But, our major concern is if one of the Influxdb instance goes down the data will be replicated to only one infuxdb instance and after the recovery of the failed instance the data will be different in both instances for the particular period of time since both the instances will not be in sync. So this is the major concern for not choosing this option. Any suggestions regarding this scenario please ?

---

<div class="post-metadata">

**Author:** ![rawkode](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rawkode/32/5161_2.png) [@rawkode](https://community.influxdata.com/u/rawkode)\
**Post date:** [February 6, 2019, 1:18pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/7 "2019-02-06T13:18:00Z")

</div>

Hi @harika2724,

Would you like to speak to a member of our sales team to get information on Influx Enterprise?

---

<div class="post-metadata">

**Author:** ![hbs](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/hbs/32/2732_2.png) [@hbs](https://community.influxdata.com/u/hbs)\
**Post date:** [February 6, 2019, 8:29pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/8 "2019-02-06T20:29:28Z")

</div>

Vente Privée is maintaining a fork of the influxb-relay project at [https://github.com/vente-privee/influxdb-relay](https://github.com/vente-privee/influxdb-relay)

---

<div class="post-metadata">

**Author:** ![voiprodrigo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/voiprodrigo/32/1762_2.png) [@voiprodrigo](https://community.influxdata.com/u/voiprodrigo)\
**Post date:** [February 7, 2019, 5:26pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/9 "2019-02-07T17:26:14Z")

</div>

Another option would be to use a message broker like Kafka. Telegraf \> Kafka \< Telegraf \> InfluxDB.  
In which case you’ll trade memory pressure for disk pressure, which will be easier to manage.

---

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [February 11, 2019, 10:56pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/10 "2019-02-11T22:56:28Z")

</div>

Thanks @voiprodrigo we are planning to do a POC on Influxdb replication using Influxdb relay for our environment which involves telegraf-\>Influxdb-\>grafana. Can anyone please let us know how to configure telegraf to send the data to influxdb relay and from there to influxdb.

---

<div class="post-metadata">

**Author:** ![voiprodrigo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/voiprodrigo/32/1762_2.png) [@voiprodrigo](https://community.influxdata.com/u/voiprodrigo)\
**Post date:** [February 11, 2019, 11:20pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/11 "2019-02-11T23:20:01Z")

</div>

Just as you would configure it if pushing directly to InfluxDB. It’s just another hop in the middle.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [February 12, 2019, 12:35am UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/12 "2019-02-12T00:35:08Z")

</div>

I think these days you can use Telegraf in place of influxdb-relay too, just configure it with a single `influxdb_listener` input and multiple `influxdb` outputs.

---

<div class="post-metadata">

**Author:** ![harika2724](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@harika2724](https://community.influxdata.com/u/harika2724)\
**Post date:** [February 20, 2019, 6:59pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/13 "2019-02-20T18:59:25Z")

</div>

Hi @daniel thanks for the response we are trying to implement the workflow that includes telegraf → Influxdb-relay → Influxdb → grafana. Please let me know if this can be achieved.

We are trying this approach because

we are using Telegraf, Influxdb and Grafana for Monitoring our environment. We have two datacenters dc1 and dc2. Each datacenter has one pod of Influxdb running. we want some approach to replicate the data between two influxdb instances running across two datacenters. So, if dc1 goes down we can have the data of both datacenters(dc1 and dc2) in dc2. We are using opensource Influxdb so can anyone please suggest some approaches to achieve this?

Tried to follow Replication during ingest approach of Telegraf where we configure two influxdb urls of both datacenters in telegraf.conf as per this [https://www.influxdata.com/blog/multiple-data-center-replication-influxdb/](https://www.influxdata.com/blog/multiple-data-center-replication-influxdb/) documentation but, what if one of the influxdb is down? and also after it’s recovery both influxdb instances will have different data so, we do not want to follow this approach.

Please let me know if the above mentioned approach of telegraf to influxdb-relay to Influxdb to Grafana works?

---

<div class="post-metadata">

**Author:** ![dhruv395](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@dhruv395](https://community.influxdata.com/u/dhruv395)\
**Post date:** [May 29, 2019, 12:58pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/14 "2019-05-29T12:58:34Z")

</div>

hi harika, please let me know if you have got the solution for higher availability of influxdb, grafana and telegraf for monitoring purpose. I am looking for a guidance regarding this.

---

<div class="post-metadata">

**Author:** ![Harrag](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/harrag/32/4605_2.png) [@Harrag](https://community.influxdata.com/u/Harrag)\
**Post date:** [July 12, 2019, 5:52am UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/15 "2019-07-12T05:52:45Z")

</div>

@dhruv395 , you could try telegraf -\> 2 rabbitmq/kafka queues -\> 2 influxdb -\> grafana, with this metics will be queued up if an outage occurs

---

<div class="post-metadata">

**Author:** ![maxadamo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/maxadamo/32/3341_2.png) [@maxadamo](https://community.influxdata.com/u/maxadamo)\
**Post date:** [September 20, 2019, 10:43am UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/16 "2019-09-20T10:43:12Z")

</div>

I can recommend influxdb-srelay:

> **[GitHub - toni-moreno/influxdb-srelay: Service to online route, filter, modify ...](https://github.com/toni-moreno/influxdb-srelay)**
>
> Service to online route, filter, modify and replicate metrics from InfluxDB or prometheus sources to InfluxDB DB's - GitHub - toni-moreno/influxdb-srelay: Service to online route, filter, m...

in conjunction with:

> **[GitHub - toni-moreno/syncflux: SyncFlux is an Open Source InfluxDB Data...](https://github.com/toni-moreno/syncflux)**
>
> SyncFlux is an Open Source InfluxDB Data synchronization and replication tool for migration purposes or HA clusters - GitHub - toni-moreno/syncflux: SyncFlux is an Open Source InfluxDB Data sync...

Syncflux, takes care of re-sync operation,and it can be used in daemon mode (it’s called `ha-monitor`), but I don’t think it’s a mature code yet (I have seen it consuming lot of TCP socket), but it works pretty well, to run a manual resync after one crash.  
Let’s imagine you want to resync the last 96 hours only:

`syncflux -action fullcopy -start -96h`

---

<div class="post-metadata">

**Author:** ![ahiyaz](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@ahiyaz](https://community.influxdata.com/u/ahiyaz)\
**Post date:** [May 14, 2020, 1:00pm UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/17 "2020-05-14T13:00:51Z")

</div>

hi @harika2724

im struggling with the same issue, what did work for you eventually?  
i see people suggested a variety

thanks

---

<div class="post-metadata">

**Author:** ![naveen\_kumar](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/naveen_kumar/32/9559_2.png) [@naveen\_kumar](https://community.influxdata.com/u/naveen_kumar)\
**Post date:** [February 25, 2022, 7:05am UTC](https://community.influxdata.com/t/influxdb-database-replication-for-high-availability/8365/18 "2022-02-25T07:05:51Z")

</div>

how to achieve that?  
is there any website we can refer?
