[Elasticsearch] Elasticsearch 5.0 GA 살펴보기 - 1

Elastic/Elasticsearch 2016. 11. 2. 17:11
내년에 업그레이드를 해야 하기 때문에 한번 살펴 보고자 합니다.

오늘은 가볍게 다운 받고 압축 풀고 기본 구조가 어떻게 변경이 되었나 한번 살펴 보려 합니다.


[다운로드]

https://www.elastic.co/downloads/elasticsearch


$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz


[압축해제]

$ tar -xvzf elasticsearch-5.0.0.tar.gz

$ ln -s elasticsearch-5.0.0 elasticsearch


[바로실행]

$ bin/elasticsearch


[2016-11-02T16:52:22,051][INFO ][o.e.n.Node               ] [] initializing ...

[2016-11-02T16:52:22,246][INFO ][o.e.e.NodeEnvironment    ] [DiStpli] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [734.4gb], net total_space [930.3gb], spins? [unknown], types [hfs]

[2016-11-02T16:52:22,247][INFO ][o.e.e.NodeEnvironment    ] [DiStpli] heap size [1.9gb], compressed ordinary object pointers [true]

[2016-11-02T16:52:22,248][INFO ][o.e.n.Node               ] [DiStpli] node name [DiStpli] derived from node ID; set [node.name] to override

[2016-11-02T16:52:22,268][INFO ][o.e.n.Node               ] [DiStpli] version[5.0.0], pid[14095], build[253032b/2016-10-26T04:37:51.531Z], OS[Mac OS X/10.12.1/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_72/25.72-b15]

[2016-11-02T16:52:23,487][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [aggs-matrix-stats]

[2016-11-02T16:52:23,487][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [ingest-common]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-expression]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-groovy]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-mustache]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-painless]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [percolator]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [reindex]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [transport-netty3]

[2016-11-02T16:52:23,488][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [transport-netty4]

[2016-11-02T16:52:23,489][INFO ][o.e.p.PluginsService     ] [DiStpli] no plugins loaded

[2016-11-02T16:52:27,399][INFO ][o.e.n.Node               ] [DiStpli] initialized

[2016-11-02T16:52:27,399][INFO ][o.e.n.Node               ] [DiStpli] starting ...

[2016-11-02T16:52:27,809][INFO ][o.e.t.TransportService   ] [DiStpli] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}

[2016-11-02T16:52:30,900][INFO ][o.e.c.s.ClusterService   ] [DiStpli] new_master {DiStpli}{DiStpli8S4-rE5QKCPP_Lw}{bwHQPV_UTl6NSPCfx8IE3w}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)

[2016-11-02T16:52:30,974][INFO ][o.e.h.HttpServer         ] [DiStpli] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}

[2016-11-02T16:52:30,974][INFO ][o.e.n.Node               ] [DiStpli] started

[2016-11-02T16:52:30,975][INFO ][o.e.g.GatewayService     ] [DiStpli] recovered [0] indices into cluster_state


[접속]

http://localhost:9200


{
  "name" : "DiStpli",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "eA4iUJ4BSoOxmoDbLjFgoQ",
  "version" : {
    "number" : "5.0.0",
    "build_hash" : "253032b",
    "build_date" : "2016-10-26T04:37:51.531Z",
    "build_snapshot" : false,
    "lucene_version" : "6.2.0"
  },
  "tagline" : "You Know, for Search"
}



[디렉토리구조]

$ ls -al

total 56

drwxr-xr-x  12  staff    408 11  2 16:52 .

drwxr-xr-x  34  staff   1156 11  2 16:45 ..

-rw-r--r--   1  staff  11358 10 26 13:35 LICENSE.txt

-rw-r--r--   1  staff    150 10 26 13:35 NOTICE.txt

-rw-r--r--   1  staff   9108 10 26 13:35 README.textile

drwxr-xr-x  15  staff    510 10 26 13:40 bin

drwxr-xr-x   6  staff    204 11  2 16:52 config

drwxr-xr-x   3  staff    102 11  2 16:52 data

drwxr-xr-x  36  staff   1224 10 26 13:40 lib

drwxr-xr-x   6  staff    204 11  2 16:52 logs

drwxr-xr-x  12  staff    408 10 26 13:40 modules

drwxr-xr-x   2  staff     68 11  2 16:52 plugins


- 실행 후 모습 입니다.


[디렉토리 bin]

- 실행 파일들이 위치해 있습니다.


[디렉토리 config]

- elasticsearch.yml 은 그대로 존재 합니다.

- logging.yml 은 log4j2.properties 로 변경 되었습니다.

- jvm.options 가 추가 되었습니다.

기존에 실행 시 설정에 필요했던 jvm 옵션을 스크립트에 추가 하기 위해 커스텀하게 사용했는데요. 이 옵션이 생겨서 좀 더 유연해 졌내요.

- scripts 디렉토리가 생겼습니다.

잘 아시겠지만 각종 script 관련 코드를 이곳에 저장하고 읽어 들일 수 있도록 된 것 같습니다.


[디렉토리 data]

- 예전 그대로 같지만 조금 달라졌습니다.

즉, 예전에는 data/클러스터명/nodes/0 뭐 이런 식이였는데요.

지금은 data/nodes/0 으로 생성이 되내요.

클러스터명이 사라졌내요. (여전히 default cluster_name 은 elasticsearch 입니다.)


[디렉토리 lib]

- 바뀐건 종속 라이브러리가 바뀌었내요.


[디렉토리 modules]

- elastic 에서 제공하는 추가 modules 들이 들어 있습니다.


[디렉토리 plugins]

- 바뀐건 아마도 plugin 만드는 방법이 바뀌었을 것 같습니다.


[초간단 클러스터 구성 테스트]

- 기본적으로 elasticsearch 는 bin/elasticsearch 를 여러번 실행 하면 클러스터로 묶어 줍니다.

단, 인스턴스를 분리 하셔야 합니다.


$ bin/elasticsearch

[2016-11-02T17:21:04,689][INFO ][o.e.n.Node               ] [] initializing ...

[2016-11-02T17:21:04,770][INFO ][o.e.e.NodeEnvironment    ] [npjHq7P] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [734.4gb], net total_space [930.3gb], spins? [unknown], types [hfs]

[2016-11-02T17:21:04,771][INFO ][o.e.e.NodeEnvironment    ] [npjHq7P] heap size [1.9gb], compressed ordinary object pointers [true]

[2016-11-02T17:21:04,772][INFO ][o.e.n.Node               ] [npjHq7P] node name [npjHq7P] derived from node ID; set [node.name] to override

[2016-11-02T17:21:04,773][INFO ][o.e.n.Node               ] [npjHq7P] version[5.0.0], pid[14680], build[253032b/2016-10-26T04:37:51.531Z], OS[Mac OS X/10.12.1/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_72/25.72-b15]

[2016-11-02T17:21:05,375][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [aggs-matrix-stats]

[2016-11-02T17:21:05,375][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [ingest-common]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [lang-expression]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [lang-groovy]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [lang-mustache]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [lang-painless]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [percolator]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [reindex]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [transport-netty3]

[2016-11-02T17:21:05,376][INFO ][o.e.p.PluginsService     ] [npjHq7P] loaded module [transport-netty4]

[2016-11-02T17:21:05,377][INFO ][o.e.p.PluginsService     ] [npjHq7P] no plugins loaded

[2016-11-02T17:21:06,764][INFO ][o.e.n.Node               ] [npjHq7P] initialized

[2016-11-02T17:21:06,765][INFO ][o.e.n.Node               ] [npjHq7P] starting ...

[2016-11-02T17:21:06,895][INFO ][o.e.t.TransportService   ] [npjHq7P] publish_address {127.0.0.1:9301}, bound_addresses {[fe80::1]:9301}, {[::1]:9301}, {127.0.0.1:9301}

[2016-11-02T17:21:09,996][INFO ][o.e.c.s.ClusterService   ] [npjHq7P] detected_master {DiStpli}{DiStpli8S4-rE5QKCPP_Lw}{oJ9y-SxJTYex3ZNBmRIpoQ}{127.0.0.1}{127.0.0.1:9300}, added {{DiStpli}{DiStpli8S4-rE5QKCPP_Lw}{oJ9y-SxJTYex3ZNBmRIpoQ}{127.0.0.1}{127.0.0.1:9300},}, reason: zen-disco-receive(from master [master {DiStpli}{DiStpli8S4-rE5QKCPP_Lw}{oJ9y-SxJTYex3ZNBmRIpoQ}{127.0.0.1}{127.0.0.1:9300} committed version [7]])

[2016-11-02T17:21:10,030][INFO ][o.e.h.HttpServer         ] [npjHq7P] publish_address {127.0.0.1:9201}, bound_addresses {[fe80::1]:9201}, {[::1]:9201}, {127.0.0.1:9201}

[2016-11-02T17:21:10,031][INFO ][o.e.n.Node               ] [npjHq7P] started



$ bin/elasticsearch

[2016-11-02T17:19:34,869][INFO ][o.e.n.Node               ] [] initializing ...

[2016-11-02T17:19:35,074][INFO ][o.e.e.NodeEnvironment    ] [DiStpli] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [734.4gb], net total_space [930.3gb], spins? [unknown], types [hfs]

[2016-11-02T17:19:35,074][INFO ][o.e.e.NodeEnvironment    ] [DiStpli] heap size [1.9gb], compressed ordinary object pointers [true]

[2016-11-02T17:19:35,076][INFO ][o.e.n.Node               ] [DiStpli] node name [DiStpli] derived from node ID; set [node.name] to override

[2016-11-02T17:19:35,079][INFO ][o.e.n.Node               ] [DiStpli] version[5.0.0], pid[14588], build[253032b/2016-10-26T04:37:51.531Z], OS[Mac OS X/10.12.1/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_72/25.72-b15]

[2016-11-02T17:19:37,110][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [aggs-matrix-stats]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [ingest-common]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-expression]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-groovy]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-mustache]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [lang-painless]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [percolator]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [reindex]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [transport-netty3]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] loaded module [transport-netty4]

[2016-11-02T17:19:37,111][INFO ][o.e.p.PluginsService     ] [DiStpli] no plugins loaded

[2016-11-02T17:19:40,144][INFO ][o.e.n.Node               ] [DiStpli] initialized

[2016-11-02T17:19:40,145][INFO ][o.e.n.Node               ] [DiStpli] starting ...

[2016-11-02T17:19:40,356][INFO ][o.e.t.TransportService   ] [DiStpli] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300}



[2016-11-02T17:19:43,625][INFO ][o.e.c.s.ClusterService   ] [DiStpli] new_master {DiStpli}{DiStpli8S4-rE5QKCPP_Lw}{oJ9y-SxJTYex3ZNBmRIpoQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)

[2016-11-02T17:19:43,742][INFO ][o.e.g.GatewayService     ] [DiStpli] recovered [0] indices into cluster_state

[2016-11-02T17:19:43,750][INFO ][o.e.h.HttpServer         ] [DiStpli] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}

[2016-11-02T17:19:43,750][INFO ][o.e.n.Node               ] [DiStpli] started

[2016-11-02T17:21:09,966][INFO ][o.e.c.s.ClusterService   ] [DiStpli] added {{npjHq7P}{npjHq7PlTqqiB2bhXkIxqQ}{IhQPGv_rTsyd7a1DbXFMwA}{127.0.0.1}{127.0.0.1:9301},}, reason: zen-disco-node-join[{npjHq7P}{npjHq7PlTqqiB2bhXkIxqQ}{IhQPGv_rTsyd7a1DbXFMwA}{127.0.0.1}{127.0.0.1:9301}]

[2016-11-02T17:21:10,007][WARN ][o.e.d.z.ElectMasterService] [DiStpli] value for setting "discovery.zen.minimum_master_nodes" is too low. This can result in data loss! Please set it to at least a quorum of master-eligible nodes (current value: [-1], total number of master-eligible nodes used for publishing in this round: [2])

- 친절하게 quorum 구성 하라고 메시지도 보여 주내요.

: