# How to increase number of shards in parallel that are initializing or relocating

**URL:** https://discuss.elastic.co/t/how-to-increase-number-of-shards-in-parallel-that-are-initializing-or-relocating/294946
**Category:** Elasticsearch
**Created:** [January 20, 2022, 11:52am UTC](https://discuss.elastic.co/t/how-to-increase-number-of-shards-in-parallel-that-are-initializing-or-relocating/294946 "2022-01-20T11:52:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lecko](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@lecko](https://discuss.elastic.co/u/lecko)
#### Post date: [January 20, 2022, 11:52am UTC](https://discuss.elastic.co/t/how-to-increase-number-of-shards-in-parallel-that-are-initializing-or-relocating/294946/1 "2022-01-20T11:52:31Z")

</div>

Hello. I use Elasticsearch 6.8 in a cluster of 8 servers. Sometimes I need to do some hardware task on one of servers and need to move shards from that node to others or initilaize them on other nodes. Before start I run flush command and then stop Elasticsearch process and then initializing of shards starts on other nodes and all finishes well. Only complain is It just takes long time like 8 or 10 hours.

At the start of initilizing it shows 12 shards initializing, later it falls to 2 . Despite that status of Elasticsearch cluster is sometimes RED it continues slowly.

I mean this values shown by cluster health command:

```auto
 "relocating_shards" : 0,
  "initializing_shards" : 2,

```

Is there a way to tell Elasticsearch, to have more shards in parallel, that are being processed, like initilaizing on relocating.

Thank you.

---

<div class="post-metadata">

### Author: ![angelo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angelo/32/61325_2.png) [@angelo](https://discuss.elastic.co/u/angelo)
#### Post date: [January 20, 2022, 7:59pm UTC](https://discuss.elastic.co/t/how-to-increase-number-of-shards-in-parallel-that-are-initializing-or-relocating/294946/2 "2022-01-20T19:59:47Z")

</div>

You should check the [Cluster](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/modules-cluster.html) module for settings that you can use. The concern is if your cluster is showing 'RED' status, that means that you do not have a primary or replica copy for some shard(s). The recommendation would be to use shard allocation filtering to 'drain' the node you plan on taking down and only stop the Elasticsearch process when the nodes has no more shards.

After you bring the node online, just remove the setting (set it to `null`, no quotes) and the cluster will be allowed to balance again and move shards back to that node.

With regards to making this go faster, the Cluster Level Shard Allocation settings can also be bumped up to allow for more shards to move concurrently. Please check your current settings and increase accordingly - monitor that you are not impacting or overwhelming the nodes by setting this too high, etc.

---

<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: [February 17, 2022, 8:00pm UTC](https://discuss.elastic.co/t/how-to-increase-number-of-shards-in-parallel-that-are-initializing-or-relocating/294946/3 "2022-02-17T20:00:35Z")

</div>

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