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

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:

 "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.

You should check the Cluster 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.

1 Like

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