티스토리 뷰

 

Version : 7.12 (2021.05)

elastic/elasticsearch

 

elastic/elasticsearch

Free and Open, Distributed, RESTful Search Engine. Contribute to elastic/elasticsearch development by creating an account on GitHub.

github.com

Elasticsearch?

  • Open Source, Distributed, Reftful Search Engine
  • 분산 검색 (distributed search) 및 분석 엔진 (analytics engine)
  • JSON 기반의 분산형 오픈 소스 RESTful 검색 엔진으로, 사용하기 쉽고, 확장 가능
  • Beats를 이용해 앱과 인프라에서 메트릭을 수집 및 전송하는 것에서부터 Logstash를 이용해 제3의 데이터 저장소에서 데이터를 풀링 등
  • Near Real-Time Search & Analytics
  • 모든 유형의 데이터에 대해 실시간 검색 및 분석 제공
  • 구조화되었거나 구조화되지 않은 텍스트, 숫자 데이테, 지리 공간 데이터 등 지원
  • 효육적으로 저장하고 색인 생성
  • 데이터의 추세와 패턴 발견 가능
  • 데이터 볼륨이 증가함에 따라 분산 관리 가능
  • 전통적인 URI 검색 방식에서 Request Body 방식의 Query DSL
  • 5.x 버전부터 Elastic Stack
  • Elastic Stack 의 핵심

기능

  • 검색 엔진
    • 다른 검색 엔진은?
      • Lucene
      • Apache Solr
  • 분산 스토리지
  • 분산 처리
    • ex) hadoop map reduce
  •  
  • Logstash & Beats 와 연동이 쉬움
  • Elasticsearch 도 만능은 아니기 때문에 데이터 종료, 형태 등에 따라서 적합한 플랫폼 선택해야함
  • Distributed, Scalable
    • Cluster, Node, Index, Shard, Replica
  • HA (High-Availability)
  • Distributed Document Store
  • Aggregations
  • Near Real-Time (NRT, 준실시간)
    • indexing, Refresh
  • Full Text Searching Engine
    • Document
    • Segment
    • inverted index
    • Token
  • REST APIs

Distributed, Scalable

Scale Horizontally | Elasticsearch: The Definitive Guide [2.x] | Elastic

 

Scale Horizontally | Elasticsearch: The Definitive Guide [2.x] | Elastic

Of course, just having more replica shards on the same number of nodes doesn’t increase our performance at all because each shard has access to a smaller fraction of its node’s resources. You need to add hardware to increase throughput. But these extra

www.elastic.co

  • P : Primary, 원본, write, 본인의 replica 관리
  • R : Replica, 복제본, read
  • Node : Elasticsearch Instacne (보통 서버당 1대)
  • Replica (데이터 복제본)을 이용해서 장애 시 데이터 복구
  • Node 추가 시 데이터가 분산되어서 저장 (rellocating)
  • 샤드 - 원본 데이터를 나누는 단위, 그림에서는 샤드 3(P0, P1, P2)
  • 예시) 그림에서 Node 1이 장애가 발생 → Node2-R1, Node3-R2 가 있기 때문에 복구 가능, Replica 데이터로 Replica 데이터가 있는 서버에 Primary (원본) 데이터 생성

Near Real-Time (NRT)

Near Real-Time Search | Elasticsearch: The Definitive Guide [2.x] | Elastic

 

Near Real-Time Search | Elasticsearch: The Definitive Guide [2.x] | Elastic

While a refresh is much lighter than a commit, it still has a performance cost. A manual refresh can be useful when writing tests, but don’t do a manual refresh every time you index a document in production; it will hurt your performance. Instead, your a

www.elastic.co

  • Document Data → Analysis → In-memory Buffer → Segment (Segment 되는 시점 부터 검색 가능)
  • Settings : refresh_interval: "30s"
    • 30초 이후 부터 검색 가능

Full Text Searching Engine

Elasticsearch from the Bottom Up, Part 1

 

Elasticsearch from the Bottom Up, Part 1 | Elastic Blog

In this article series, we look at Elasticsearch from a new perspective. We'll start at the 'bottom' (or close enough!) of the many abstraction levels, and gradually move upwards towards the user-visible layers, studying the various internal data structure

www.elastic.co

REST APIs

REST APIs | Elasticsearch Guide [7.12] | Elastic

 

REST APIs | Elasticsearch Guide [7.12] | Elastic

We are working on including more Elasticsearch APIs in this section. Some content might not be included yet.

www.elastic.co

  • HTTP 프로토콜로 접근이 가능한 Rest API 지원
  • 자원별로 고유 URL로 접근 가능
  • PUT, POST, GET, DELETE 를 이용해서 자원 처리

JSON Document NoSQL

  • default 로 문서의 모든 필드가 색인되어 JSON 구조로 저장
  • Schema Free를 지원하므로 별도의 사전 맵핑 없이도 JSON 문서 형식으로 전달 시 검색 가능한 형태로 색인 작업 수행
  • key & value 형태로 JSON Document 형식으로 Schema 구성 → Indexing 과정을 거처 meta field 추가 (_index, _type, _id, _score 등)

Multi-tenancy

Discovering the Need for an Indexing Strategy in Multi-Tenant Applications

 

Discovering the Need for an Indexing Strategy in Multi-Tenant Applications | Elastic Blog

There are many buzzwords that may be applied to Elasticsearch. Multi-tenancy is one. Getting started with a multi-tenant use case can be deceptively easy - there are some pitfalls that will require a little careful design.

www.elastic.co

  • Elasticsearch의 데이터들은 인덱스(Index)라는 논리적인 집한 단위로 구성
  • 서로 다른 저장소에 분산되어 저장
  • 서로 다른 인덱스들을 별도의 커넥션 없이 하나의 질의로 묶어서 검색, 출력 가능

Distributed Operation & Aggregation

  • 집계 결과는 master 노드가 여러 노드에 데이터를 집계해 질의에 답변

Reference

Elasticsearch Guide

 

Elasticsearch Guide [7.12] | Elastic

 

www.elastic.co

7.12

What's new in 7.12 | Elasticsearch Guide [7.12] | Elastic

 

What’s new in 7.12 | Elasticsearch Guide [7.12] | Elastic

Here are the highlights of what’s new and improved in Elasticsearch 7.12! For detailed information about this release, see the Release notes and Migration guide. Other versions: 7.11 | 7.10 | 7.9 | 7.8 | 7.7 | 7.6 | 7.5 | 7.4 | 7.3 | 7.2 | 7.1 | 7.0 Froz

www.elastic.co

Docker

Install Elasticsearch with Docker | Elasticsearch Guide [7.12] | Elastic

 

Install Elasticsearch with Docker | Elasticsearch Guide [7.12] | Elastic

The container runs Elasticsearch as user elasticsearch using uid:gid 1000:0. Bind mounted host directories and files must be accessible by this user, and the data and log directories must be writable by this user.

www.elastic.co

Pull

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.12.1

#single node : 개발 또는 테스트에서 단일 노드로 실행
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
  • single-node
    • 일부 사용자는 전송 클라이언트 사용을 테스트하기 위해 전송을 외부 인터페이스에 바인딩해야합니다. 이 상황에서는 검색 유형을 제공합니다 single-node(로 설정 discovery.type하여 구성 single-node). 이 상황에서 노드는 자신을 마스터로 선택하고 다른 노드와 클러스터를 결합하지 않습니다.
  • Bootstrap Checks | Elasticsearch Guide [7.12] | Elastic
 

Bootstrap Checks | Elasticsearch Guide [7.12] | Elastic

Collectively, we have a lot of experience with users suffering unexpected issues because they have not configured important settings. In previous versions of Elasticsearch, misconfiguration of some of these settings were logged as warnings. Understandably,

www.elastic.co

 

'Programming > Elastic Stack' 카테고리의 다른 글

[Elastic Stack] Kibana?  (0) 2021.05.15
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함