# Automatically balance Shard allocation

**URL:** <https://discuss.elastic.co/t/automatically-balance-shard-allocation/333682>\
**Category:** Elasticsearch\
**Created:** [May 17, 2023, 4:43pm UTC](https://discuss.elastic.co/t/automatically-balance-shard-allocation/333682 "2023-05-17T16:43:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NishuGoel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nishugoel/32/120993_2.png) [@NishuGoel](https://discuss.elastic.co/u/NishuGoel)\
**Post date:** [May 17, 2023, 4:43pm UTC](https://discuss.elastic.co/t/automatically-balance-shard-allocation/333682/1 "2023-05-17T16:43:19Z")

</div>

A maintenance applied by "System" today caused a restart of a node in our production cluster  
The restarted node started reallocating shards, not receiving traffic after 2 hours and the remaining 2 nodes were under huge pressure causing interruptions and timeouts.

The shard reallocation was messed up in the sense that it only allocated shards to 2 of the 3 nodes which were already super high on memory and kept the third node empty. Is it a bug?

We had to manually trigger \_cluster/reroute to balance it. Is there a way to always have the shard re-allocation balanced?

---

<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:** [May 18, 2023, 1:11am UTC](https://discuss.elastic.co/t/automatically-balance-shard-allocation/333682/2 "2023-05-18T01:11:36Z")

</div>

What is the output from the [`_cluster/stats?pretty&human` API](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/cluster-stats.html)?

---

<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:** [June 15, 2023, 1:12am UTC](https://discuss.elastic.co/t/automatically-balance-shard-allocation/333682/3 "2023-06-15T01:12:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
