# Queries for shard allocation failure

**URL:** <https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022>\
**Category:** Elasticsearch\
**Created:** [December 6, 2021, 8:47am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022 "2021-12-06T08:47:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pratiksha](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pratiksha](https://discuss.elastic.co/u/pratiksha)\
**Post date:** [December 6, 2021, 8:47am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/1 "2021-12-06T08:47:06Z")

</div>

I am using Elasticsearch v7.10.2. I have cluster running with many unassigned shards. I want to determine the number of retries that has already finished for the shards. Is there any way to check that as in how many retries have already been tried.  
Also, Is there any other way to trigger shard allocation manually apart from cluster-reroute api?

Thanks in advance

---

<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:** [December 6, 2021, 8:50am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/2 "2021-12-06T08:50:07Z")

</div>

> Is there any way to check that as in how many retries have already been tried.

The [cluster allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) will report `failed_attempts` if nonzero.

> [@pratiksha](#):
>
> Also, Is there any other way to trigger shard allocation manually apart from cluster-reroute api?

No, but there is no need to do anything manually unless the [cluster allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) tells you that the reroute API is needed.

---

<div class="post-metadata">

**Author:** ![pratiksha](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pratiksha](https://discuss.elastic.co/u/pratiksha)\
**Post date:** [December 6, 2021, 9:04am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/3 "2021-12-06T09:04:18Z")

</div>

Thank you for the quick information.

---

<div class="post-metadata">

**Author:** ![pratiksha](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pratiksha](https://discuss.elastic.co/u/pratiksha)\
**Post date:** [December 6, 2021, 10:03am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/4 "2021-12-06T10:03:30Z")

</div>

Is there any way we can monitor the automatic shard reallocation process ran by Elasticsearch to track how long will it take or when was it started?

---

<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:** [December 6, 2021, 10:27am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/5 "2021-12-06T10:27:24Z")

</div>

The [index recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html) shows you details of current shard movements. There's no way to calculate how long it will take, however.

---

<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:** [January 3, 2022, 10:27am UTC](https://discuss.elastic.co/t/queries-for-shard-allocation-failure/291022/6 "2022-01-03T10:27:57Z")

</div>

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