Elasticsearch

Some useful commands, before we start with the documentation (real data anonymized)

curl -XGET “http://loclhost/_cat/recovery?v”

index shard time type stage source_host target_host repository snapshot files files_percent bytes bytes_percent total_files total_bytes translog translog_percent total_translog
xxx-xx-xxx-2017.10.19 0 99 replica done 10.xxx.xxx.xxx 10.xx.xx.xx n/a n/a 0 0.0% 0 0.0% 0 0 0 100.0% 0
xxx-xxx-xxx-2017.10.19 0 61274 store done 10.xx.xx.xx 10.xx.xx.xx n/a n/a 0 100.0% 0 100.0% 85 245851218 0 100.0% 0
xx-xxx-xxx-2017.10.19 0 10312 replica done 10.xx.xx.xx 10.xx.xx.xx n/a n/a 0 0.0% 0 0.0% 0 0 0 100.0% 0
xxx-xxx-xxx-2017.10.19 1 5097 replica done 10.xx.xx.xx 10.xx.xx.xx n/a n/a 0 0.0% 0 0.0% 0 0 0 100.0% 0
xxx-xxx-xxx-2017.10.19 1 52811 store done 110.xx.xx.xx 10.xx.xx.xx n/a n/a 0 100.0% 0 100.0% 73 244969413 0 100.0% 0
xxx-xxx-xxx-2017.10.19 2 3590 store done 10.xx.xx.xx 10.xx.xx.xx n/a n/a 0 100.0% 0 100.0% 70 245541361 0 100.0% 0

curl -XGET “http://localhost:9200/_cluster/state/routing_table,routing_node/?pretty”

curl -XGET “http://127.0.0.1:9200/_cat/recovery?v&active_only=true”

curl -XGET “http://127.0.0.1:9200/_cat/pending_tasks?v”

curl -XPOST ‘localhost:9200/_cluster/reroute?pretty&explain’

curl -XPOST “http://localhost:9200/_cluster/reroute?explain”

curl -XGET “http://localhost:9200/_cat/nodes?v”
host ip heap.percent ram.percent load node.role master name
10.xx.xx.xx 10.xx.xx.xx 16 99 0.36 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 20 77 0.01 – – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 58 98 3.82 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 64 98 2.40 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 35 92 0.01 – – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 56 49 0.57 – * xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 54 94 0.02 – – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 3 22 0.09 – – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 70 98 3.41 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 55 98 2.55 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 75 98 3.18 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 54 99 1.70 d – xxxxxxxxxxxxxx
10.xx.xx.xx 10.xx.xx.xx 15 81 0.00 – – xxxxxxxxxxxxxx

Node types d data

curl -XGET “http://localhost:9200/_cluster/state/routing_table,routing_node/?pretty”

curl -XGET “http://localhost:9200/_cat/shards”

curl -XGET “http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason”

curl -XGET “http://localhost:9200/_cluster/health?level=indices”

curl -XGET “http://localhost:9200/_nodes/stats?pretty”

curl -XGET ‘http://localhost:9200/_nodes/transport?pretty=1’

curl -XGET “http://localhost:9200/_cluster/health?pretty”

GET _cluster/health?level=indices

GET _nodes/stats

Unassigned shards:

curl -XGET http://localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED

curl -XDELETE http://localhost:9200/xxxxxxx-2016.11.29

curl -XDELETE http://localhost:9200/xxxxxxx-2016*

curl ‘http://localhost:9200/_cat/indices?v’

Graham Bell

Owner, author, grafter, tea boy - you guessed it, one man band. Now a "hired hand" Linux and DevOps expert. Spent over 14 years in the Finance industry but has also worked in Pharmaceuticals, Telcos, Public Sector and a few Blue Chip global organisations.

Leave a Reply

Your email address will not be published. Required fields are marked *