# How does Cross Cluster Replication work during a DR failover?

**URL:** <https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734>\
**Category:** Elasticsearch\
**Tags:** ccr-cross-cluster-replication\
**Created:** [May 1, 2020, 4:37pm UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734 "2020-05-01T16:37:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sg.esearch](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sg.esearch](https://discuss.elastic.co/u/sg.esearch)\
**Post date:** [May 1, 2020, 4:37pm UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/1 "2020-05-01T16:37:36Z")

</div>

**Happy Scenario**  
We have setup ES on two data-centers - A and B.  
Data is coming to A from Kafka/Spark combination hosted in A too.  
ES in B has a follower index.  
ES in A has a leader index.  
Both A and B elastic clusters get read-traffic from clients local to their data-centers.

**DR setup**  
For DR-failover, Kafka/Spark are present in B as well and they get written to only if A becomes un-available.

Now during failover, B would begin to get writes from their local Kafka/Spark and not from A.

**After DR**  
Once the DR is fixed, it is expected that things would get restored to the happy-scenario.  
But how do we replicate the changes from B to A that occurred during the DR failover?  
We have inserts as well as updates.

Does ES support bi-directional CCR or anything else that can help to make the DR switching operations automatic?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 4, 2020, 7:58am UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/2 "2020-05-04T07:58:54Z")

</div>

A bit more information about your use case would be useful. Are you using time based indices? Do you update or delete data or just insert new documents?

---

<div class="post-metadata">

**Author:** ![psramkumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/psramkumar/32/31393_2.png) [@psramkumar](https://discuss.elastic.co/u/psramkumar)\
**Post date:** [May 5, 2020, 11:55pm UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/3 "2020-05-05T23:55:22Z")

</div>

are you using two different clusters?  
if so, design a solution to capture all transactions during DR window and process it once the DR window is over,

---

<div class="post-metadata">

**Author:** ![sg.esearch](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sg.esearch](https://discuss.elastic.co/u/sg.esearch)\
**Post date:** [May 7, 2020, 6:39am UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/4 "2020-05-07T06:39:13Z")

</div>

We have both kinds of clusters actually and will appreciate appropriate information for both (time-based indices and non-time-based indices)

---

<div class="post-metadata">

**Author:** ![sg.esearch](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sg.esearch](https://discuss.elastic.co/u/sg.esearch)\
**Post date:** [May 12, 2020, 5:18am UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/5 "2020-05-12T05:18:18Z")

</div>

@Christian_Dahlqvist , can you help here please?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 12, 2020, 5:40am UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/6 "2020-05-12T05:40:35Z")

</div>

True bi-directional replication for a single index is as far as I know not supported, so I suspect indices that are updated will need to be replicated one way and require manual intervention to reverse if the initial cluster fails. For data that is just indexed you can set up two set of indices, one in each site, and replicate to the other site. This is referred to as bi-directional replication in [this blog post](https://www.elastic.co/blog/cross-datacenter-replication-with-elasticsearch-cross-cluster-replication)You then write to the appropriate index in each cluster.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 9, 2020, 5:40am UTC](https://discuss.elastic.co/t/how-does-cross-cluster-replication-work-during-a-dr-failover/230734/7 "2020-06-09T05:40:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
