Force reroute all unassigned shards

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