Skip to content

Instantly share code, notes, and snippets.

@ycyr
Last active April 9, 2023 14:07
Show Gist options
  • Save ycyr/dff6866089c0ce02fc14d92f48da3273 to your computer and use it in GitHub Desktop.
Save ycyr/dff6866089c0ce02fc14d92f48da3273 to your computer and use it in GitHub Desktop.
useful elasticsearch command
curl -XGET --user elastic:changeme http://localhost:9200/_cluster/health | jq .
curl -XGET --user elastic:changeme http://localhost:9200/_cluster/allocation/explain | jq .
curl -XGET --user elastic:changeme http://localhost:9200/_cluster/health?level=indices | jq .
curl -XGET 'localhost:9200/_cat/shards/logstash*?v&bytes=m&h=index,store.size&s=store.size:desc'
curl -XGET 'localhost:9200/_cat/indices/logstash*?s=store.size:desc&h=index,pri.store.size'
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '{
"transient" :{
"cluster.routing.allocation.node_concurrent_recoveries": 20,
"indices.recovery.max_bytes_per_sec": "2048mb",
"cluster.routing.allocation.node_initial_primaries_recoveries": 20
}
}' | jq .
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '{
"transient" :{
"cluster.routing.allocation.node_concurrent_recoveries": 2,
"indices.recovery.max_bytes_per_sec": "40mb",
"cluster.routing.allocation.node_initial_primaries_recoveries": 2
}
}' | jq .
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '{
"transient" :{
"cluster.routing.allocation.disk.watermark.high" : "95%"
}
}';
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '{
"transient" :{
"cluster.routing.allocation.disk.watermark.low" : "90%"
}
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '
{ "transient":
{ "cluster.routing.allocation.enable" : "none"
}
}'
curl -XPUT --user elastic:changeme localhost:9200/_cluster/settings -d '
{ "transient":
{ "cluster.routing.allocation.enable" : "all"
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment