How to allocate all the unassigned shards at a time?

for shard in $(curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED | awk '{print $2}'); do
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "test",
"shard" : 0,
"node" : "node name",
"allow_primary" : true
}
}
]
}'
sleep 5
done

In this we can allocate one by shards belongs to particular index to a node But how can we allocate all the shards at a time

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