Last active
August 29, 2015 14:18
-
-
Save hkrishna/288e643589c8856c7309 to your computer and use it in GitHub Desktop.
Dealing with unassigned shards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" : "pelias", | |
"shard" : $shard, | |
"node" : "pelias-1", | |
"allow_primary" : true | |
} | |
} | |
] | |
}' | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment