# Unassigned shards with reason "ElasticSearch can allocate shards"

**URL:** <https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724>\
**Category:** Elasticsearch\
**Created:** [August 10, 2024, 1:39am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724 "2024-08-10T01:39:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mukularora89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mukularora89/32/126696_2.png) [@mukularora89](https://discuss.elastic.co/u/mukularora89)\
**Post date:** [August 10, 2024, 1:39am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/1 "2024-08-10T01:39:33Z")

</div>

We have recently upgraded our cluster to ES 8.12.2. We are observing unassigned shards and on further looking cluster allocation explain API we could see that can\_allocate="yes" and allocate\_explanation "Elasticsearch can allocate the shard."

It has set of available nodes which it can allocate to but it is not able to move replica shards to them.

 ![image (44)](https://us1.discourse-cdn.com/elastic/original/3X/2/1/21cc691d9324693fe1ca88cd457dfd14462c9a7e.png)

---

<div class="post-metadata">

**Author:** ![Abhishek\_Soni1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_soni1/32/108968_2.png) [@Abhishek\_Soni1](https://discuss.elastic.co/u/Abhishek_Soni1)\
**Post date:** [August 10, 2024, 2:16am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/2 "2024-08-10T02:16:02Z")

</div>

+1 I am also facing same issues

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 10, 2024, 6:51pm UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/3 "2024-08-10T18:51:55Z")

</div>

At a guess, try setting `cluster.routing.allocation.allow_rebalance: always`. This will be the default from 8.16 onwards, see [Always allow rebalancing by default by DaveCTurner · Pull Request #111015 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/pull/111015).

---

<div class="post-metadata">

**Author:** ![mukularora89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mukularora89/32/126696_2.png) [@mukularora89](https://discuss.elastic.co/u/mukularora89)\
**Post date:** [August 13, 2024, 5:03am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/4 "2024-08-13T05:03:06Z")

</div>

Even after `cluster.routing.allocation.allow_rebalance: always` setting, shards gets unassigned and on cluster allocation explain it says can\_allocate="yes" and allocate\_explanation "Elasticsearch can allocate the shard."

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 13, 2024, 7:03am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/5 "2024-08-13T07:03:03Z")

</div>

Could you share the full output of `GET _cluster/allocation/explain` and `GET _internal/desired_balance`?

---

<div class="post-metadata">

**Author:** ![mukularora89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mukularora89/32/126696_2.png) [@mukularora89](https://discuss.elastic.co/u/mukularora89)\
**Post date:** [August 14, 2024, 2:29pm UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/6 "2024-08-14T14:29:57Z")

</div>

not able to paste the full output, is there any location where I can paste?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 14, 2024, 4:15pm UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/7 "2024-08-14T16:15:53Z")

</div>

[https://gist.github.com](https://gist.github.com) is usually a good choice.

---

<div class="post-metadata">

**Author:** ![mukularora89](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mukularora89/32/126696_2.png) [@mukularora89](https://discuss.elastic.co/u/mukularora89)\
**Post date:** [August 14, 2024, 4:51pm UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/8 "2024-08-14T16:51:57Z")

</div>

> [@DavidTurner](#):
>
> [https://gist.github.com](https://gist.github.com)

pls check if you can access [https://github.com/mukularora89-dev/ES8\_Issue](https://github.com/mukularora89-dev/ES8_Issue)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 15, 2024, 6:27am UTC](https://discuss.elastic.co/t/unassigned-shards-with-reason-elasticsearch-can-allocate-shards/364724/9 "2024-08-15T06:27:07Z")

</div>

I cannot access that, it says `Page not found`.
