# Help with cluster.routing.allocation.enable Property

**URL:** <https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962>\
**Category:** Elasticsearch\
**Created:** [June 6, 2014, 6:03pm UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962 "2014-06-06T18:03:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagarit2](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagarit2](https://discuss.elastic.co/u/sagarit2)\
**Post date:** [June 6, 2014, 6:03pm UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/1 "2014-06-06T18:03:01Z")

</div>

Hi folks,

Our requirement is as follows:

We have our ES cluster running on aws instances where nodes can come and  
go. We would like to disable Shard reallocation on cluster in Normal state  
so that Node going down should not rebalance the shards.(Just to avoid  
unnecessary Network i/o).

When node comes back up (within few minutes), we would like to enable it so  
that new node will get back it's own shards and after rebalancing is  
finished, we would like to Disable Shard reallocation again.

We would like this to be an automated process rather than manual one.

I have already taken a look at following stackoverflow question/answer  
[http://stackoverflow.com/questions/16231614/quick-recovery-after-node-restart-in-elasticsearch](http://stackoverflow.com/questions/16231614/quick-recovery-after-node-restart-in-elasticsearch)  
but I am not sure if it can work in automated way.

curl -XPUT localhost:9200/\_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}'  
/etc/init.d/elasticsearch restart  
curl -XPUT localhost:9200/\_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}'

So I would like to know, is there any way to Listen to the event which says  
"Shard Rebalancing is finished" (by adding a new listener) and then  
disable cluster.routing.allocation.enable Property ?

-- Thanks

--  
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/cee6bef8-25cf-4175-ac53-f2734d44ea76%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cee6bef8-25cf-4175-ac53-f2734d44ea76%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 6, 2014, 9:21pm UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/2 "2014-06-06T21:21:51Z")

</div>

The cluster state will be yellow while shards are being rebalanced, so you  
can just execute a cluster healt request and wait for green status:

> **[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.

You can also poll the same API and wait until all the moving shards  
(relocating\_shards, initializing\_shards, unassigned\_shards) are 0.

Cheers,

Ivan

On Fri, Jun 6, 2014 at 11:03 AM, sagarl [sagarit2@gmail.com](mailto:sagarit2@gmail.com) wrote:

> Hi folks,
> 
> Our requirement is as follows:
> 
> We have our ES cluster running on aws instances where nodes can come and  
> go. We would like to disable Shard reallocation on cluster in Normal state  
> so that Node going down should not rebalance the shards.(Just to avoid  
> unnecessary Network i/o).
> 
> When node comes back up (within few minutes), we would like to enable it  
> so that new node will get back it's own shards and after rebalancing is  
> finished, we would like to Disable Shard reallocation again.
> 
> We would like this to be an automated process rather than manual one.
> 
> I have already taken a look at following stackoverflow question/answer  
> [http://stackoverflow.com/questions/16231614/quick-recovery-after-node-restart-in-elasticsearch](http://stackoverflow.com/questions/16231614/quick-recovery-after-node-restart-in-elasticsearch)  
> but I am not sure if it can work in automated way.
> 
> curl -XPUT localhost:9200/\_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}'  
> /etc/init.d/elasticsearch restart  
> curl -XPUT localhost:9200/\_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}'
> 
> So I would like to know, is there any way to Listen to the event which  
> says "Shard Rebalancing is finished" (by adding a new listener) and then  
> disable cluster.routing.allocation.enable Property ?
> 
> -- Thanks
> 
> --  
> 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/cee6bef8-25cf-4175-ac53-f2734d44ea76%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cee6bef8-25cf-4175-ac53-f2734d44ea76%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/cee6bef8-25cf-4175-ac53-f2734d44ea76%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/cee6bef8-25cf-4175-ac53-f2734d44ea76%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/CALY%3DcQCXbKF%3DDCig3xhe48yb40Tb88tLXRH2kNk3w4OxJq62aQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCXbKF%3DDCig3xhe48yb40Tb88tLXRH2kNk3w4OxJq62aQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [June 6, 2014, 9:41pm UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/3 "2014-06-06T21:41:10Z")

</div>

sagarl wrote:

> We have our ES cluster running on aws instances where nodes can  
> come and go. We would like to disable Shard reallocation on  
> cluster in Normal state so that Node going down should not  
> rebalance the shards.(Just to avoid unnecessary Network i/o).

If your shard topology is relatively static, you could just leave  
allocation disabled (or set it to new\_primaries for the occasional  
index creation). But honestly you're trying to micro-manage a  
process that ES does pretty well. There's nothing wrong with  
having a yellow cluster. If you're concerned about availability  
you should add replicas.

Drew

--  
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/m2y4x9wwax.fsf%40mid.raines.me](https://groups.google.com/d/msgid/elasticsearch/m2y4x9wwax.fsf%40mid.raines.me).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![sagarit2](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sagarit2](https://discuss.elastic.co/u/sagarit2)\
**Post date:** [June 6, 2014, 10:23pm UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/4 "2014-06-06T22:23:18Z")

</div>

Thanks Ivan for the suggestions, I'll try to make use of them.

Drew, Sorry I din't get the part when you said "There's nothing wrong with  
having a yellow cluster" And yes I agree ES does a good job of rebalancing  
but just think of a case where you have close to few hundred GBs of data  
per shard which will move around the cluster even though the new node takes  
only few minutes to come back up. Hence, looking to avoid unnecessary  
network i/O.

-- Sagar

On Friday, June 6, 2014 2:41:37 PM UTC-7, Drew Raines wrote:

> sagarl wrote:
> 
> > We have our ES cluster running on aws instances where nodes can  
> > come and go. We would like to disable Shard reallocation on  
> > cluster in Normal state so that Node going down should not  
> > rebalance the shards.(Just to avoid unnecessary Network i/o).
> 
> If your shard topology is relatively static, you could just leave  
> allocation disabled (or set it to new\_primaries for the occasional  
> index creation). But honestly you're trying to micro-manage a  
> process that ES does pretty well. There's nothing wrong with  
> having a yellow cluster. If you're concerned about availability  
> you should add replicas.
> 
> Drew

--  
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/386d674e-52b8-4ed1-95ce-6efcf03718c0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/386d674e-52b8-4ed1-95ce-6efcf03718c0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [June 7, 2014, 2:42am UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/5 "2014-06-07T02:42:36Z")

</div>

sagarl wrote:

> Drew, Sorry I din't get the part when you said "There's nothing  
> wrong with having a yellow cluster" And yes I agree ES does a  
> good job of rebalancing but just think of a case where you have  
> close to few hundred GBs of data per shard which will move  
> around the cluster even though the new node takes only few  
> minutes to come back up. Hence, looking to avoid unnecessary  
> network i/O.

If you were referring to /planned/ node outages, then I agree. I  
thought you were trying to reinvent schemes for dealing with the  
unpredictable. Apologies for misinterpreting!

Drew

--  
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/m2ppilwicj.fsf%40mid.raines.me](https://groups.google.com/d/msgid/elasticsearch/m2ppilwicj.fsf%40mid.raines.me).  
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:24am UTC](https://discuss.elastic.co/t/help-with-cluster-routing-allocation-enable-property/17962/6 "2017-07-06T01:24:03Z")

</div>


