# Multi-data center deployments

**URL:** <https://discuss.elastic.co/t/multi-data-center-deployments/5132>\
**Category:** Elasticsearch\
**Created:** [August 12, 2011, 4:56am UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132 "2011-08-12T04:56:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glynn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glynn/32/3140_2.png) [@Glynn](https://discuss.elastic.co/u/Glynn)\
**Post date:** [August 12, 2011, 4:56am UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132/1 "2011-08-12T04:56:58Z")

</div>

Assuming an ElasticSearch deployment has only one shard but there are  
several nodes, in two discrete data centres.

If communications between the data centres is interrupted, each node  
can continue to operate (because with one shard, all the data is  
"local") but what happens to changes that are written to separate  
nodes? i.e. when inter-data-centre communications are restored, and  
the nodes discover each other again:

- Do writes that have happened in centre A get replicated to centre B?
- What happens if document X is modified in centre A AND in centre B?

Thanks in advance.

Glynn

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 13, 2011, 4:42pm UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132/2 "2011-08-13T16:42:37Z")

</div>

If you have one shard and I assume a replica, if the connection between the  
two is interrupted, then the side with the replica shard will promote that  
shard to become primary, and by default, will allow for writes. It will  
also, assuming you have enough nodes, will allocate the additional shard to  
the cluster.

Cross data center replication has been discussed in the mailing list, its  
something that requires specific features to be developed to address it.

On Fri, Aug 12, 2011 at 7:56 AM, Glynn [glynn.bird@gmail.com](mailto:glynn.bird@gmail.com) wrote:

> Assuming an Elasticsearch deployment has only one shard but there are  
> several nodes, in two discrete data centres.
> 
> If communications between the data centres is interrupted, each node  
> can continue to operate (because with one shard, all the data is  
> "local") but what happens to changes that are written to separate  
> nodes? i.e. when inter-data-centre communications are restored, and  
> the nodes discover each other again:
> 
> - Do writes that have happened in centre A get replicated to centre B?
> - What happens if document X is modified in centre A AND in centre B?
> 
> Thanks in advance.
> 
> Glynn

---

<div class="post-metadata">

**Author:** ![Mohit\_Anchlia](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Mohit\_Anchlia](https://discuss.elastic.co/u/Mohit_Anchlia)\
**Post date:** [August 13, 2011, 5:19pm UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132/3 "2011-08-13T17:19:48Z")

</div>

On Sat, Aug 13, 2011 at 9:42 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> If you have one shard and I assume a replica, if the connection between the  
> two is interrupted, then the side with the replica shard will promote that  
> shard to become primary, and by default, will allow for writes. It will  
> also, assuming you have enough nodes, will allocate the additional shard to  
> the cluster.

Does it autmatically replicate once the old shard is back in the  
cluster? I mean how does it keep the data in sync because the new  
shard doesn't have all the data.

Is there a link that gives this information in detail? It will help me  
understand this.

> Cross data center replication has been discussed in the mailing list, its  
> something that requires specific features to be developed to address it.
> 
> On Fri, Aug 12, 2011 at 7:56 AM, Glynn [glynn.bird@gmail.com](mailto:glynn.bird@gmail.com) wrote:
> 
> > Assuming an Elasticsearch deployment has only one shard but there are  
> > several nodes, in two discrete data centres.
> > 
> > If communications between the data centres is interrupted, each node  
> > can continue to operate (because with one shard, all the data is  
> > "local") but what happens to changes that are written to separate  
> > nodes? i.e. when inter-data-centre communications are restored, and  
> > the nodes discover each other again:
> > 
> > - Do writes that have happened in centre A get replicated to centre B?
> > - What happens if document X is modified in centre A AND in centre B?
> > 
> > Thanks in advance.
> > 
> > Glynn

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 13, 2011, 5:34pm UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132/4 "2011-08-13T17:34:24Z")

</div>

> Does it autmatically replicate once the old shard is back in the  
> cluster? I mean how does it keep the data in sync because the new  
> shard doesn't have all the data.

If you have one replica, then you have two copies of the data: the  
primary, and the replica.

Have a look at Shay's presentation at Berlin Buzzwords - it explains all  
of this in much more detail:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<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:** [July 6, 2017, 3:57am UTC](https://discuss.elastic.co/t/multi-data-center-deployments/5132/5 "2017-07-06T03:57:09Z")

</div>


