Wednesday, May 4, 2016

ElasticSearch Command and Scripts


  • Figure out the health of clusters
    • http://192.168.1.90:9200/_cluster/health?pretty=true
  • Query nodes stats:
    • GET http://192.168.1.90:9200/_nodes/stats/fs,indices?pretty
  • Index shards
    • http://192.168.1.90:9200/leap/_search_shards 
  • List all indexes:
    • http://9.30.217.20:9200/_cat/indices?v
  • List all the index and types:
    • http://9.30.217.20:9200/_mapping?pretty=true
  • List documents from an index and type:
    • http://9.30.217.20:9200/<index_name>/<doc_type>/_search
  • Create an index with 3 shards only:
      POST http://192.168.1.90:9200/leap
      {
          "settings" : {
              "index" : {
                  "number_of_shards" : 3,
                  "number_of_replicas" : 1
              }
          }
      }
      

       

No comments:

Post a Comment