StoryCode

매뉴얼-https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html

Elastic Search
반응형

 

 

https://www.elastic.co/guide/kr/index.html

  https://www.elastic.co/guide/kr/elasticsearch/reference/current/index.html 

  https://www.elastic.co/guide/kr/logstash/current/index.html

  https://www.elastic.co/guide/kr/kibana/current/index.html

 

 

반응형

'Elastic Search' 카테고리의 다른 글

데이터 탐색.샘플데이터 집합 로드  (0) 2019.04.29
모든 색인 나열/ 생성  (0) 2019.04.28
클러스터 상태 보기  (0) 2019.04.28
설치  (0) 2019.04.28
Elastic Search 란  (0) 2019.04.18

클러스터 상태 보기

Elastic Search
반응형

1. curl http://127.0.0.1:9200/_cat/health?v

epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1556456126 12:55:26  elasticsearch green           1         1      0   0    0    0        0             0                  -                100.0%

 

# elasticsearch 가 green 임을 확인 가능.

 

색상 : green/ yellow/ red

녹색 모두 양호한 상태(클러스터가 정상 작동 중)
노란색 모든 데이터가 사용 가능한 상태이지만 일부 리플리카가 아직 배정되지 않은 상태(클러스터는 정상 작동 중)
빨간색

어떤 이유로 일부 데이터가 사용할 수 없는 상태

클러스터가 빨간색이더라도 아직 부분적으로 작동하는 중. = 사용 가능 샤드에서 계속 검색 요청을 처리.

 

데이터가 누락되므로 서둘러 문제를 해결해야 합니다.

 

2. curlcurl http://127.0.0.1:9200/_cat/nodes?v

ip             heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
172.16.174.148            8          40   0    0.01    0.01     0.00 mdi       *      0l3cD0_

 

# 이 클러스트에는 노드="0l3cD0_" 가 유일.

 

 

반응형

설치

Elastic Search
반응형

1. 환경

Ubuntu 18.10 liveserver

 

2. ElasticSearch 매뉴얼 페이지 참조

https://www.elastic.co/guide/kr/elasticsearch/reference/current/gs-installation.html

 

3. Java 11 설치

참조 : https://tecadmin.net/install-oracle-java-11-ubuntu-18-04-bionic/

> sudo apt update

> sudo apt upgrade

> sudo add-apt-repository ppa:linuxuprising/java

> sudo apt update

> sudo apt install oracle-java11-installer

> sudo apt install oracle-java11-set-default

> java -version

 

4. Elastic Search 설치

> mkdir download

> cd download

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.3.tar.gz

   # 혹은 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-linux-x86_64.tar.gz

> cd /usr/local

> tar zxvf ~/download/elasticsearch-5.4.3.tar.gz

   # tar zxvf ~/download/elasticsearch-7.0.0-linux-x86_64.tar.gz

 

> grep vm.max_map_count /etc/sysctl.conf

> sudo sysctl -w vm.max_map_count=262144

# 각종 옵션 참조 https://okayjava.tistory.com/30 참조

cd elasticsearch-5.4.3/config

 

# 참조 : https://www.elastic.co/guide/en/elasticsearch/reference/2.3/setup-configuration.html

> vi config/elasticsearch.yml

   # 외부에서 접근가능하게 하려면 elastic 5.4.3 에서는 network.host: 0.0.0.0 으로 수정해야함. 7 에서는 모르겠음.

   # 보통은 kibana 통해서 접근하니 # 으로 막아놓채로 elasticsearch 실행할 것.

cd elasticsearch-5.4.3/bin

> ./elasticsearch # no root account, service elasticsearch restart

   # 클러스트/노드명 설정시 : ./elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name

 

4.1

외부에서 접근 가능하면 Chrome> http://172.16.174.148:9200/ 확인.

아니면 localhost:9200으로만 접근 가능.

 

"name" : "0l3cD0_", "cluster_name" : "elasticsearch", "cluster_uuid" : "YFlzj7AiQcuZm73LyWIujQ", "version" : { "number" : "5.4.3", "build_hash" : "eed30a8", "build_date" : "2017-06-22T00:34:03.743Z", "build_snapshot" : false, "lucene_version" : "6.5.1" }, "tagline" : "You Know, for Search" }

 

5. curl 로 기본 상태 확인. ( _cat 은 Elastic Cluster 체크 명령 )

> curl http://127.0.0.1:9200/_cat/health?v

 

샘플결과>

poch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1556456126 12:55:26  elasticsearch green           1         1      0   0    0    0        0             0                  -                100.0%

반응형