# Can a data node be set up to only be allocated replicas?

**URL:** https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533
**Category:** Elasticsearch
**Created:** [July 8, 2014, 4:16pm UTC](https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533 "2014-07-08T16:16:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ned\_Campion](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ned_campion/32/1385_2.png) [@Ned\_Campion](https://discuss.elastic.co/u/Ned_Campion)
#### Post date: [July 8, 2014, 4:16pm UTC](https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533/1 "2014-07-08T16:16:04Z")

</div>

Hi All,

Been a real joy working with es, and today I'm trying to see if I can stump  
es with a tricky config.

Say I have 2 data nodes that contain a collection of indices that were set  
up with number\_of\_shards=1 and number\_of\_replicas=1.

Say I want to add a data node that only contains replicas of the existing  
shards. My understanding is I can spin up the new data node and then update  
the indices to auto\_expand\_replicas=0-all and the new data node will  
acquire a replica of all the existing shards.

But, my struggle is to ensure that going forward when new indices are  
created that this 3rd node does not get any primary shards.

The general goal is to have a small subset of data nodes that are allowed  
to get primary (and replica) shards while another subset of data nodes are  
only allowed to get replica shards.

I've been wrestling with auto\_expand\_replicas and the  
[index,cluster].routing.allocation.enable settings and can't figure out how  
to make it work.

Any suggestions from the es masters out there?

Many thanks,  
Ned

--  
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/b4459e87-4df2-4667-97a8-10bf62360d5f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b4459e87-4df2-4667-97a8-10bf62360d5f%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ned\_Campion](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ned_campion/32/1385_2.png) [@Ned\_Campion](https://discuss.elastic.co/u/Ned_Campion)
#### Post date: [July 8, 2014, 5:12pm UTC](https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533/2 "2014-07-08T17:12:50Z")

</div>

Never mind. Anyone please correct me if I'm wrong, but after some thought I  
think I've convinced myself that there is no need for such a setup. I think  
it's ok for the 3rd node to get primary shards. Still have to test this,  
but if I were to have auto\_expand\_replicas set up on all the indices and I  
were to remove the node then the number of replicas would decrease by one  
and a replica on the other 2 data nodes would be elected as a primary.

N

On Tuesday, July 8, 2014 12:16:04 PM UTC-4, Ned Campion wrote:

> Hi All,
> 
> Been a real joy working with es, and today I'm trying to see if I can  
> stump es with a tricky config.
> 
> Say I have 2 data nodes that contain a collection of indices that were set  
> up with number\_of\_shards=1 and number\_of\_replicas=1.
> 
> Say I want to add a data node that only contains replicas of the existing  
> shards. My understanding is I can spin up the new data node and then update  
> the indices to auto\_expand\_replicas=0-all and the new data node will  
> acquire a replica of all the existing shards.
> 
> But, my struggle is to ensure that going forward when new indices are  
> created that this 3rd node does not get any primary shards.
> 
> The general goal is to have a small subset of data nodes that are allowed  
> to get primary (and replica) shards while another subset of data nodes are  
> only allowed to get replica shards.
> 
> I've been wrestling with auto\_expand\_replicas and the  
> [index,cluster].routing.allocation.enable settings and can't figure out how  
> to make it work.
> 
> Any suggestions from the es masters out there?
> 
> Many thanks,  
> Ned

--  
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/2e8e7972-3cbc-4074-85a9-f31b6616f81b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e8e7972-3cbc-4074-85a9-f31b6616f81b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [July 8, 2014, 9:46pm UTC](https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533/3 "2014-07-08T21:46:59Z")

</div>

There's not really a need as you've discovered.  
ES is really good at managing distribution of shards, and unless you are  
running specific hardware for storage (ie tiered storage across different  
nodes) or you want rack awareness, then it's better to just let ES deal  
with the allocation of primary/replicas.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 9 July 2014 03:12, Ned Campion [nedcampion@gmail.com](mailto:nedcampion@gmail.com) wrote:

> Never mind. Anyone please correct me if I'm wrong, but after some thought  
> I think I've convinced myself that there is no need for such a setup. I  
> think it's ok for the 3rd node to get primary shards. Still have to test  
> this, but if I were to have auto\_expand\_replicas set up on all the indices  
> and I were to remove the node then the number of replicas would decrease by  
> one and a replica on the other 2 data nodes would be elected as a primary.
> 
> N
> 
> On Tuesday, July 8, 2014 12:16:04 PM UTC-4, Ned Campion wrote:
> 
> > Hi All,
> > 
> > Been a real joy working with es, and today I'm trying to see if I can  
> > stump es with a tricky config.
> > 
> > Say I have 2 data nodes that contain a collection of indices that were  
> > set up with number\_of\_shards=1 and number\_of\_replicas=1.
> > 
> > Say I want to add a data node that only contains replicas of the existing  
> > shards. My understanding is I can spin up the new data node and then update  
> > the indices to auto\_expand\_replicas=0-all and the new data node will  
> > acquire a replica of all the existing shards.
> > 
> > But, my struggle is to ensure that going forward when new indices are  
> > created that this 3rd node does not get any primary shards.
> > 
> > The general goal is to have a small subset of data nodes that are allowed  
> > to get primary (and replica) shards while another subset of data nodes are  
> > only allowed to get replica shards.
> > 
> > I've been wrestling with auto\_expand\_replicas and the  
> > [index,cluster].routing.allocation.enable settings and can't figure out  
> > how to make it work.
> > 
> > Any suggestions from the es masters out there?
> > 
> > Many thanks,  
> > Ned
> 
> --  
> 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/2e8e7972-3cbc-4074-85a9-f31b6616f81b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2e8e7972-3cbc-4074-85a9-f31b6616f81b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2e8e7972-3cbc-4074-85a9-f31b6616f81b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2e8e7972-3cbc-4074-85a9-f31b6616f81b%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/CAEM624aKQwKXzeMUrObfxkpL8HiS323R4%2BWFRtnk-VGWRqJ1MQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624aKQwKXzeMUrObfxkpL8HiS323R4%2BWFRtnk-VGWRqJ1MQ%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, 1:17am UTC](https://discuss.elastic.co/t/can-a-data-node-be-set-up-to-only-be-allocated-replicas/18533/4 "2017-07-06T01:17:14Z")

</div>


