Basic Architecture of ElasticSearch

이상민·2021년 4월 24일
0
post-thumbnail

1. Basic Architecture of ElasticSearch

  • when running ElasticSearch, we start up a node

  • Node : instance of ElasticSearch that stores part of data

    • nodes can be distributed across multiple machines
  • Cluster : collection of related nodes that together contain all of data

    • clusters are independent to each other
    • cross cluster search is possible, but not common
    • node either joins a cluster of create new cluster

2. Storing Data in ElasticSearch

  • each unit of data stored within a cluster is called a document

  • Documents : JSON objects

  • when indexing a document, original json object is stored with added metadata

  • Documents are organized within an index

    • when searching, index is specified so as to search within index


3. Acess Cluster

cluster exposes a REST API to communicate by

3-1. Kibana Console

ex1) check cluster health

  GET /_cluster/health
  • _cluster : API, API begins with underscore
  • health : Command

ex2) search

  GET /.kibana/_search {
      "query": {
          "match_all": {}
      }
  }

3-2. cURL

ex1) check cluster health

  $curl -xGET "http://localhost:9200/_cluster/health"

ex2) search

  $curl -xGET "http://localhost:9200/.kibana/_search" -H "Content-Type : application/json" -d"{ "query": { "match-all": {} } }"
profile
편하게 읽기 좋은 단위의 포스트를 추구하는 개발자입니다

0개의 댓글