Force shard re-allocation

Retry allocation of all failed/unassigned shards

curl -X POST http://es:9200/_cluster/reroute?retry_failed=true

tool
elasticsearch19 commands
tags
elasticsearchdebug

More elasticsearch commands

  • curl -X PUT 'http://es:9200/my-index/_settings' -H 'Content-Type: application/json' -d '{"index":{"number_of_replicas":1}}'

    Change replica count on a live index

  • curl -X PUT 'http://es:9200/_index_template/logs-tpl' -H 'Content-Type: application/json' -d '{"index_patterns":["logs-*"],"template":{"settings":{"number_of_shards":2}}}'

    Auto-configure new indices matching logs-*

  • curl -X PUT 'http://es:9200/_snapshot/my_repo/snap1?wait_for_completion=true'

    Create a cluster snapshot synchronously

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

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

  • 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

all 19 elasticsearch commands