# How to find out if replication is in progress in a cluster

**URL:** <https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193>\
**Category:** Elasticsearch\
**Created:** [October 12, 2018, 8:56am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193 "2018-10-12T08:56:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [October 12, 2018, 8:56am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/1 "2018-10-12T08:56:04Z")

</div>

hello,

I am looking for a reliable way where we can say that replication is in progress on a node ?

From the below output, what are the parameters based on which i can reliably tell that replication is in progress/completed on a cluster ?  
I know that cluster status "yellow" is 1 way , can we also rely on any other parameters apart from status ?

GET \_cluster/health

COPY AS CURL[VIEW IN CONSOLE](http://localhost:5601/app/kibana#/dev_tools/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/cluster-health/1.json)

Returns this:

{ "cluster\_name" : "testcluster", "status" : "yellow", "timed\_out" : false, "number\_of\_nodes" : 1, "number\_of\_data\_nodes" : 1, "active\_primary\_shards" : 5, "active\_shards" : 5, "relocating\_shards" : 0, "initializing\_shards" : 0, "unassigned\_shards" : 5, "delayed\_unassigned\_shards": 0, "number\_of\_pending\_tasks" : 0, "number\_of\_in\_flight\_fetch": 0, "task\_max\_waiting\_in\_queue\_millis": 0, "active\_shards\_percent\_as\_number": 50.0 }

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [October 12, 2018, 9:17am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/2 "2018-10-12T09:17:47Z")

</div>

> [@sss](#):
>
> "relocating\_shards" : 0, "initializing\_shards" : 0,

This tells you that no shards are currently being initialized or relocated, which means Elasticsearch is done balancing your cluster.

> [@sss](#):
>
> "unassigned\_shards" : 5

The reason your cluster is in a yellow state is because of these 5 unassigned shards, that will remain unassigned because they are replicas of the 5 primary shards you have. The reason they can't be assigned is that you cluster only has one data node:

> [@sss](#):
>
> "number\_of\_data\_nodes" : 1

A replica shard can never be assigned to the same node hosting the primary (because a main point with replica shards is to provide backup if a node goes down). There are two ways you can make your cluster state green:

1. Add a second data node so that replica shards can be assigned.
2. Turn off replica shards for your indices (see [Update Indices Settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html)).

Good luck!

---

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [October 12, 2018, 10:29am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/3 "2018-10-12T10:29:45Z")

</div>

Thank you for your response..

i undertstand how to fix the cluster status Yellow.

My question is if there is any way to identify if cluster status is yellow because of an ongoing replication process within cluster.. Can we conclude that if replication is yellow because of ongoing replication, then the "relocating shards" and "initializing shards settings" values will be non-zero

---

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [October 16, 2018, 5:44am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/4 "2018-10-16T05:44:29Z")

</div>

Any reply for this question ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 16, 2018, 5:47am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/5 "2018-10-16T05:47:16Z")

</div>

Maybe you could use the [cat recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/cat-recovery.html) or [indices recovery API](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-recovery.html)?

---

<div class="post-metadata">

**Author:** ![sss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sss/32/31486_2.png) [@sss](https://discuss.elastic.co/u/sss)\
**Post date:** [October 16, 2018, 6:55am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/6 "2018-10-16T06:55:53Z")

</div>

Thanks christian for reposne...

This looks little confusing.. Documentation says that this is the response for a live recovery.. But the stage is shown as done. Does this make sense ? Also, what are the valid recovery stages and recovery types (peer | store | snapshot)

i s t ty st  
twitter 0 1252ms peer done

---

<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:** [November 13, 2018, 6:55am UTC](https://discuss.elastic.co/t/how-to-find-out-if-replication-is-in-progress-in-a-cluster/152193/7 "2018-11-13T06:55:58Z")

</div>

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