# Disable re balancing if one node is down

**URL:** <https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882>\
**Category:** Elasticsearch\
**Created:** [March 25, 2015, 7:47am UTC](https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882 "2015-03-25T07:47:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrilcherian](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@cyrilcherian](https://discuss.elastic.co/u/cyrilcherian)\
**Post date:** [March 25, 2015, 7:47am UTC](https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882/1 "2015-03-25T07:47:38Z")

</div>

Imagine a case where I have

- 3(AWS) Nodes
- 1 Index (lest call it friends) with 3 shards and 1 replica.

Name Conventions  
S1 (Index friends primary shard 1)  
S2 (Index friends primary shard 2)  
S3 (Index friends primary shard 3)  
R1 (Replica of Shard 1)  
R2 (Replica of Shard 2)  
R3 (Replica of Shard 3)

Lets say that Node1 has (S1 R2) and is the master  
Node2 has (S2 R3)  
Node3 has (S3 R1)

Now if due to connection failure Node 2 goes down.  
Load balancing will happen and  
Node 1 will promote the replica (R2) as primary and new replica for (R2)  
will be created in Node3  
Finally after load balancing it will be like  
Node1 has (S1 S2, R3)  
Node3 has (S3 R1, R2)

During this re balancing heavy IO operations happen and the Elastic search  
health will become red -\> yellow then green.

My requirement is that if Node 2 is down the nodes must not re balance.  
I am ok if the results on query shows results from only shard S1 and S3.  
And when Node 2 is back again no re balancing should happen.

Is this possible..if yes how.  
Thanks is advance.

--  
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/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%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:** [March 25, 2015, 8:24pm UTC](https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882/2 "2015-03-25T20:24:34Z")

</div>

That's not possible, you either rebalance everything or nothing.

On 25 March 2015 at 18:47, Cyril Cherian [cyril@mobomo.com](mailto:cyril@mobomo.com) wrote:

> Imagine a case where I have
> 
> - 3(AWS) Nodes
> - 1 Index (lest call it friends) with 3 shards and 1 replica.
> 
> Name Conventions  
> S1 (Index friends primary shard 1)  
> S2 (Index friends primary shard 2)  
> S3 (Index friends primary shard 3)  
> R1 (Replica of Shard 1)  
> R2 (Replica of Shard 2)  
> R3 (Replica of Shard 3)
> 
> Lets say that Node1 has (S1 R2) and is the master  
> Node2 has (S2 R3)  
> Node3 has (S3 R1)
> 
> Now if due to connection failure Node 2 goes down.  
> Load balancing will happen and  
> Node 1 will promote the replica (R2) as primary and new replica for (R2)  
> will be created in Node3  
> Finally after load balancing it will be like  
> Node1 has (S1 S2, R3)  
> Node3 has (S3 R1, R2)
> 
> During this re balancing heavy IO operations happen and the Elastic search  
> health will become red -\> yellow then green.
> 
> My requirement is that if Node 2 is down the nodes must not re balance.  
> I am ok if the results on query shows results from only shard S1 and S3.  
> And when Node 2 is back again no re balancing should happen.
> 
> Is this possible..if yes how.  
> Thanks is advance.
> 
> --  
> 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/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f2cfcc49-3b92-4b0f-a071-eb0b6e5ac387%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/CAEYi1X8T2gw02N%2BAjXHGFjyJzxs7DzhDEhTRRtkc3fCC%3DVmD7g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X8T2gw02N%2BAjXHGFjyJzxs7DzhDEhTRRtkc3fCC%3DVmD7g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![mjdude5](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mjdude5](https://discuss.elastic.co/u/mjdude5)\
**Post date:** [March 26, 2015, 5:16pm UTC](https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882/3 "2015-03-26T17:16:49Z")

</div>

You can get a some reallocation control through  
cluster.routing.allocation.enable but getting the exact config you mention  
I don't think is possible. You could write a cluster-watching script that  
does what you describe though using these settings. One problem you will  
have is when node2 comes back it needs to re-sync it's replicas from the  
masters, but you can stop balancing after one node goes down via  
cluster.routing.allocation.enable

On Wednesday, March 25, 2015 at 3:47:38 AM UTC-4, Cyril Cherian wrote:

> Imagine a case where I have
> 
> - 3(AWS) Nodes
> - 1 Index (lest call it friends) with 3 shards and 1 replica.
> 
> Name Conventions  
> S1 (Index friends primary shard 1)  
> S2 (Index friends primary shard 2)  
> S3 (Index friends primary shard 3)  
> R1 (Replica of Shard 1)  
> R2 (Replica of Shard 2)  
> R3 (Replica of Shard 3)
> 
> Lets say that Node1 has (S1 R2) and is the master  
> Node2 has (S2 R3)  
> Node3 has (S3 R1)
> 
> Now if due to connection failure Node 2 goes down.  
> Load balancing will happen and  
> Node 1 will promote the replica (R2) as primary and new replica for (R2)  
> will be created in Node3  
> Finally after load balancing it will be like  
> Node1 has (S1 S2, R3)  
> Node3 has (S3 R1, R2)
> 
> During this re balancing heavy IO operations happen and the Elastic search  
> health will become red -\> yellow then green.
> 
> My requirement is that if Node 2 is down the nodes must not re balance.  
> I am ok if the results on query shows results from only shard S1 and S3.  
> And when Node 2 is back again no re balancing should happen.
> 
> Is this possible..if yes how.  
> Thanks is advance.

--  
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/0a4ce39d-134b-4cd8-a49b-3785a06ae3d9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a4ce39d-134b-4cd8-a49b-3785a06ae3d9%40googlegroups.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:23am UTC](https://discuss.elastic.co/t/disable-re-balancing-if-one-node-is-down/22882/4 "2017-07-06T00:23:38Z")

</div>


