Skip to content

Instantly share code, notes, and snippets.

@pat-humphreys
Created May 13, 2016 13:51
Show Gist options
  • Save pat-humphreys/f6dc3ff2f51e5c588ddff9883922935e to your computer and use it in GitHub Desktop.
Save pat-humphreys/f6dc3ff2f51e5c588ddff9883922935e to your computer and use it in GitHub Desktop.
Collection of useful elasticsearch commands
#If elasticsearch has unassigned replicas that it isnt assigning (normally after a cluster restart/recovery).
#Realocation and merging might need to be re-enabled
#Might need to be done on all nodes
curl -XPUT 'localhost:9200/_settings' -d '{"index.routing.allocation.disable_allocation": false}'
#Lists all keys for an index
curl localhost:9200/index-name/index-type/_search/?size=1000&pretty=1
#Turns off/on index replicas
curl -XPUT localhost:9200/index-name/_settings -d '{"number_of_replicas": 0}'
#Disable throttling
curl -XPUT localhost:9200/_cluster/settings -d '{"transient" : {"indices.store.throttle.type" : "none" }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment