# 2 Servers with 2 primary shards... optimization questions

**URL:** <https://discuss.elastic.co/t/2-servers-with-2-primary-shards-optimization-questions/21781>\
**Category:** Elasticsearch\
**Created:** [January 22, 2015, 4:30pm UTC](https://discuss.elastic.co/t/2-servers-with-2-primary-shards-optimization-questions/21781 "2015-01-22T16:30:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darin\_Hensley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darin_hensley/32/32794_2.png) [@Darin\_Hensley](https://discuss.elastic.co/u/Darin_Hensley)\
**Post date:** [January 22, 2015, 4:30pm UTC](https://discuss.elastic.co/t/2-servers-with-2-primary-shards-optimization-questions/21781/1 "2015-01-22T16:30:43Z")

</div>

With this set up:

Server1 Server2

* * *

Primary Shard 1 Primary Shard 2  
Replica Shard 1 Replica Shard 2

1. If primary shard 1 failed, would replica shard 1 take over and become  
primary shard 1?
2. Is reading performance optimized from 2 primary shards on 2 separate  
severs?
3. With documentation stating "we would end up with two nodes having one  
shard each, and one node doing double the work with two  
shards."...specifically the "one node doing double the work with two  
shards"....do they mean 1 server having a primary shard and a replica  
shard?

* * *

Also,

Server1 Server2

* * *

Primary Shard 1 Primary Shard 2  
Replica Shard 2 Replica Shard 1

1. is this set up possible and would it be beneficial? If so, would I have  
to manually assign the shards or is this how ES does it default wise with 2  
servers and 2 shards?
2. with this set up...if it is even possible...is there a read performance  
from having Primary Shard 1 on server 1 and having Replica Shard 1 on  
server 2?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Kimbro\_Staken](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Kimbro\_Staken](https://discuss.elastic.co/u/Kimbro_Staken)\
**Post date:** [January 22, 2015, 7:06pm UTC](https://discuss.elastic.co/t/2-servers-with-2-primary-shards-optimization-questions/21781/2 "2015-01-22T19:06:41Z")

</div>

Your second example is what elasticsearch will do by default. It will never  
allocate a primary and replica for the same shard on the same node. In that  
example if one of the nodes were to go down both primaries would move to  
the remaining node and the replicas would be unallocated and the cluster  
will have yellow status.

Kimbro

On Thu, Jan 22, 2015 at 9:30 AM, Darin Hensley [darin.hensley@gmail.com](mailto:darin.hensley@gmail.com)  
wrote:

> With this set up:
> 
> Server1 Server2
> 
> * * *
> 
> Primary Shard 1 Primary Shard 2  
> Replica Shard 1 Replica Shard 2
> 
> 1. If primary shard 1 failed, would replica shard 1 take over and become  
> primary shard 1?
> 2. Is reading performance optimized from 2 primary shards on 2 separate  
> severs?
> 3. With documentation stating "we would end up with two nodes having one  
> shard each, and one node doing double the work with two  
> shards."...specifically the "one node doing double the work with two  
> shards"....do they mean 1 server having a primary shard and a replica  
> shard?
> 
> * * *
> 
> Also,
> 
> Server1 Server2
> 
> * * *
> 
> Primary Shard 1 Primary Shard 2  
> Replica Shard 2 Replica Shard 1
> 
> 1. is this set up possible and would it be beneficial? If so, would I have  
> to manually assign the shards or is this how ES does it default wise with 2  
> servers and 2 shards?
> 2. with this set up...if it is even possible...is there a read performance  
> from having Primary Shard 1 on server 1 and having Replica Shard 1 on  
> server 2?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/3a16db74-e41f-469a-aecd-acf515074391%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAA0DmXbmJBAFQgN8%2BKGmtsd8m6vnYYOhzCuczig9Y%2BSNbKnWCg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAA0DmXbmJBAFQgN8%2BKGmtsd8m6vnYYOhzCuczig9Y%2BSNbKnWCg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:37am UTC](https://discuss.elastic.co/t/2-servers-with-2-primary-shards-optimization-questions/21781/3 "2017-07-06T00:37:09Z")

</div>


