StoryCode

설치

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%

반응형