List all indexes on ElasticSearch server?

前端 未结 23 1106
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 09:55

I would like to list all indexes present on an ElasticSearch server. I tried this:

curl -XGET localhost:9200/

but it just gives me this:

23条回答
  •  抹茶落季
    2020-12-12 10:21

    One of the best way to list indices + to display its status together with list : is by simply executing below query.

    Note: preferably use Sense to get the proper output.

    curl -XGET 'http://localhost:9200/_cat/shards'
    

    The sample output is as below. The main advantage is, it basically shows index name and the shards it saved into, index size and shards ip etc

    index1     0 p STARTED     173650  457.1mb 192.168.0.1 ip-192.168.0.1 
    index1     0 r UNASSIGNED                                                 
    index2     1 p STARTED     173435  456.6mb 192.168.0.1 ip-192.168.0.1 
    index2     1 r UNASSIGNED                                                 
    ...
    ...
    ...
    

提交回复
热议问题