Cluster health

Show cluster status: green/yellow/red, shards, nodes

curl -s http://localhost:9200/_cluster/health | jq .

tool
elasticsearch19 commands
tags
elasticsearchmonitoring

More elasticsearch commands

  • curl -s 'http://localhost:9200/_cat/indices?v&h=index,health,pri,rep,docs.count,store.size&s=store.size:desc'

    Tabular index listing sorted by size

  • curl -X DELETE http://localhost:9200/<index>

    Remove an index and all its data

  • curl -s http://localhost:9200/<index>/_settings | jq .

    Inspect number of shards, replicas, refresh interval

  • curl -X POST http://localhost:9200/_reindex -H 'Content-Type: application/json' -d '{"source":{"index":"old"},"dest":{"index":"new"}}'

    Copy documents from one index to another

  • curl -X POST 'http://localhost:9200/<index>/_forcemerge?max_num_segments=1'

    Reduce segment count; useful before making index read-only

all 19 elasticsearch commands