Force reroute all unassigned shards

Hi All,

I have an ES cluster with 3 nodes and ES version 2.4.1. I have around 2000 shards in UNASSIGNED state. Is there a way where i can force assign all of them?

And what is the best way to avoid this.

--
Niraj

1 Like

Hi, can you tell us how many indices and replicas you have ?

And what is the data size.

wow 2000 unassigned, sounds like you have a lot of shards (assigned+unassigned).

I have fixed my issue. The issue was related to my disk on root being full to 95% so elasticsearch was not processing further shard allocation. Once i added additional space to my disk , it works perfectly fine.

yeah it is a bigdata consisting of around 600 amazon account's cloudtrail logs.

1 Like

You can reallocate unassigned indexes as follows:

First query for unassigned indexes:
curl http://Elastic:92xx/_cat/indices?pretty

Filter the unassigned shards.

Create a script which allocates unassigned shards to a data node:

curl -XPOST -d "{ ""commands"" : [ {  ""allocate"" : {""index"" : """[IndexNumber]""", ""shard"" : [shardnumber], ""node"" : ""[data-nodename]"",""allow_primary"":true      }   } ] }" http://localhost:9203/_cluster/reroute?pretty
1 Like

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