curl -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD $ELASTIC_URL
alias ecurl="curl -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD"
ecurl $ELASTIC_URL
ecurl $ELASTIC_URL/_cluster/health?pretty
ecurl $ELASTIC_URL/_cat/nodes?pretty
ecurl $ELASTIC_URL/_cat/indices/cem-*?s=index
ecurl $ELASTIC_URL/_cat/indices/cem-*?s=store.size
ecurl $ELASTIC_URL/_cat/indices/cem-*?s=docs.count
Information about an index settings
GET /.kibana/_settings?include_defaults
- symptoms / issues :
error type: validation_exception, reason: Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [2000]/[2000] maximum shards open;
- solution :
GET /_cluster/settings?include_defaults=true PUT /_cluster/settings { "persistent": { "cluster.max_shards_per_node":10000 } }
GET /_cluster/stats
to get the number of shards (fast)GET _stats
to get the number shards (slow)
symptoms / issues :
- cluster in red state
- many indices in red state
- unassigned shards
- many indices in red state
# -----------------------------------------------
# RECOVERING RED INDICES (UNASSIGNED SHARDS)
# https://www.fpcomplete.com/blog/2018/04/recover-your-elasticsearch/#:~:text=Despite%20overall%20Elasticsearch%20stability%2C%20it,running%20out%20of%20disk%20space.
GET _cluster/state/routing_table
GET _cat/shards?v
POST _cluster/reroute?retry_failed
# can take times, check progress using :
GET _cluster/health?pretty
# unassigned_shards should decrease & active_shards increase
GET _cat/shards?v