Elastic Search 엔진에 대한 설치를 했다고 하더라도 중요한건 무엇이 어떻게 얼마나 저장이 되고 있는지, 그 부분에 대한 확인을 할 수 있는 부분을 다양한 플러그인으로 제공을 하고 있습니다.
그 중에서도 오늘은 Elastic Search 을 설치해보고, 그 플러그인의 일부인 Elastic Search HQ, SQL 2가지에 대한 설치 및 결과를 공유하고자 합니다.
1. ElasticSearch 설치
# wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/zip/elasticsearch/2.1.0/elasticsearch-2.1.0.zip
# unzip elasticsearch-2.1.0.zip
# cd elasticsearch-2.1.0/bin
# ./elasticsearch
Standalone 설치는 매우 간단하다.
정상적으로 실행 된 상황이라면 http://localhost:9200 으로 접속 했을 때 간단한 health 정보가 표시된다.
※ 참고사항
1.1 Elastic 설치를 위해 JRE 8 설치 필요함
[root@elasticlogh bin]# ./elasticsearch
Exception in thread "main" java.lang.RuntimeException: Java version: Oracle Corporation 1.7.0_51 [Java HotSpot(TM) 64-Bit Server VM 24.51-b03] suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption. Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations. If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JAVA_OPTS environment variable. Upgrading is preferred, this workaround will result in degraded performance. at org.elasticsearch.bootstrap.JVMCheck.check(JVMCheck.java:123) at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:283) at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35) Refer to the log for complete error details. |
1.2 root 권한으로 elasticsearch 기동 시 RuntimeException 발생
. 해결 방법 : ./elsticsearch -Des.insecure.allow.root=true 옵션 추가
1.3 Elastic Search 사용하는 포트 변경 시 : elasticsearch-2.1.0/config/elasticsearch.yml 파일 수정
. 로그 발생 내용
network.host: 192.168.0.1
# # Set a custom port for HTTP: # # http.port: 9200 |
2. ElasticSearch 플러그인 설치
- ElasticHQ : https://github.com/royrusso/elasticsearch-HQ
기존에 Head라는 플러그인을 썼는데 UI가 조금 마음에 들지 않아서 다른 것을 찾던중 깔끔한 UI에 Head보다 좀더 자세한 정보들을 보여주고 있는 HQ를 Head대신 최근에는 쓰고 있다.
- ElasticSQL : https://github.com/NLPchina/elasticsearch-sql
ES내에 있는 JSON Document를 SQL로 검색 할 수 있는 플러그인이다.
SQL에 익숙한 개발자가 대부분이다보니 매우 쉽고 간편하게 SQL을 이용해 ES 데이터를 분석 할 수 있다.
# ./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.1.0/elasticsearch-sql-2.1.0.zip
# ./bin/plugin install royrusso/elasticsearch-HQ