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


2. 압축 해제 후


3. 해당 폴더의 빈 공간에 "Shift + 우클릭"하여 "여기서 명령 창 열기" 혹은 "여기에 PowerShell 창 열기"를 선택합니다.


4.

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
PS C:\elasticsearch-6.3.0\elasticsearch-6.3.0\bin> .\elasticsearch
[2018-07-05T13:09:33,162][INFO ][o.e.n.Node               ] [] initializing ...
[2018-07-05T13:09:33,232][INFO ][o.e.e.NodeEnvironment    ] [_dQxEAG] using [1] data paths, mounts [[(C:)]], net usable_space [463.2gb], net total_space [930.1gb], types [NTFS]
[2018-07-05T13:09:33,232][INFO ][o.e.e.NodeEnvironment    ] [_dQxEAG] heap size [989.8mb], compressed ordinary object pointers [true]
[2018-07-05T13:09:33,238][INFO ][o.e.n.Node               ] [_dQxEAG] node name derived from node ID [_dQxEAGURO6gbD4nbCYUVA]; set [node.name] to override
[2018-07-05T13:09:33,238][INFO ][o.e.n.Node               ] [_dQxEAG] version[6.3.0], pid[7084], build[default/zip/424e937/2018-06-11T23:38:03.357887Z], OS[Windows 10/10.0/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_101/25.101-b13]
[2018-07-05T13:09:33,239][INFO ][o.e.n.Node               ] [_dQxEAG] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=C:\Users\Admin\AppData\Local\Temp\elasticsearch, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Delasticsearch, -Des.path.home=C:\elasticsearch-6.3.0\elasticsearch-6.3.0, -Des.path.conf=C:\elasticsearch-6.3.0\elasticsearch-6.3.0\config, -Des.distribution.flavor=default, -Des.distribution.type=zip]
[2018-07-05T13:09:35,533][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [aggs-matrix-stats]
[2018-07-05T13:09:35,534][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [analysis-common]
[2018-07-05T13:09:35,534][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [ingest-common]
[2018-07-05T13:09:35,534][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [lang-expression]
[2018-07-05T13:09:35,534][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [lang-mustache]
[2018-07-05T13:09:35,535][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [lang-painless]
[2018-07-05T13:09:35,535][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [mapper-extras]
[2018-07-05T13:09:35,535][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [parent-join]
[2018-07-05T13:09:35,535][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [percolator]
[2018-07-05T13:09:35,535][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [rank-eval]
[2018-07-05T13:09:35,536][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [reindex]
[2018-07-05T13:09:35,536][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [repository-url]
[2018-07-05T13:09:35,536][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [transport-netty4]
[2018-07-05T13:09:35,536][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [tribe]
[2018-07-05T13:09:35,536][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-core]
[2018-07-05T13:09:35,538][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-deprecation]
[2018-07-05T13:09:35,539][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-graph]
[2018-07-05T13:09:35,540][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-logstash]
[2018-07-05T13:09:35,541][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-ml]
[2018-07-05T13:09:35,542][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-monitoring]
[2018-07-05T13:09:35,543][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-rollup]
[2018-07-05T13:09:35,549][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-security]
[2018-07-05T13:09:35,550][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-sql]
[2018-07-05T13:09:35,551][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-upgrade]
[2018-07-05T13:09:35,552][INFO ][o.e.p.PluginsService     ] [_dQxEAG] loaded module [x-pack-watcher]
[2018-07-05T13:09:35,553][INFO ][o.e.p.PluginsService     ] [_dQxEAG] no plugins loaded
[2018-07-05T13:09:39,882][INFO ][o.e.x.s.a.s.FileRolesStore] [_dQxEAG] parsed [0] roles from file [C:\elasticsearch-6.3.0\elasticsearch-6.3.0\config\roles.yml]
[2018-07-05T13:09:40,439][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/22068] [Main.cc@109] controller (64 bit): Version 6.3.0 (Build 0f0a34c67965d7) Copyright (c) 2018 Elasticsearch BV
[2018-07-05T13:09:40,739][DEBUG][o.e.a.ActionModule       ] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2018-07-05T13:09:40,980][INFO ][o.e.d.DiscoveryModule    ] [_dQxEAG] using discovery type [zen]
[2018-07-05T13:09:41,726][INFO ][o.e.n.Node               ] [_dQxEAG] initialized
[2018-07-05T13:09:41,726][INFO ][o.e.n.Node               ] [_dQxEAG] starting ...
[2018-07-05T13:09:44,151][INFO ][o.e.t.TransportService   ] [_dQxEAG] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2018-07-05T13:09:47,228][INFO ][o.e.c.s.MasterService    ] [_dQxEAG] zen-disco-elected-as-master ([0] nodes joined)[, ], reason: new_master {_dQxEAG}{_dQxEAGURO6gbD4nbCYUVA}{NLBAt36xS-mMf0j_sKL9CA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=17087102976, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2018-07-05T13:09:47,234][INFO ][o.e.c.s.ClusterApplierService] [_dQxEAG] new_master {_dQxEAG}{_dQxEAGURO6gbD4nbCYUVA}{NLBAt36xS-mMf0j_sKL9CA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=17087102976, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {_dQxEAG}{_dQxEAGURO6gbD4nbCYUVA}{NLBAt36xS-mMf0j_sKL9CA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=17087102976, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)[, ]]])
[2018-07-05T13:09:47,532][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [_dQxEAG] Failed to clear cache for realms [[]]
[2018-07-05T13:09:47,560][INFO ][o.e.l.LicenseService     ] [_dQxEAG] license [b37d9cae-d9d3-471e-b94a-dee571e45476] mode [basic] - valid
[2018-07-05T13:09:47,582][INFO ][o.e.g.GatewayService     ] [_dQxEAG] recovered [0] indices into cluster_state
[2018-07-05T13:09:48,868][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [_dQxEAG] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2018-07-05T13:09:48,869][INFO ][o.e.n.Node               ] [_dQxEAG] started
 
cs


5. 확인

 : http://localhost:9200



* 아래와 같은 에러 발생 시

1
2
3
4
5
{
  "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
  "status" : 406
}
 
cs



* curl 명령어에 옵션을 다음과 같이 추가하여 실행합니다.

1
2
-H 'Content-Type: application/json'
 
cs


 : 추가 전

1
2
3
4
5
6
7
8
9
10
$ curl -XPUT master:9200/customer/external/1?pretty -d'
> {
>   "name": "John Doe"
> }
> '
{
  "error" : "Content-Type header [application/x-www-form-urlencoded] is not supported",
  "status" : 406
}
 
cs


 : 추가 후

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ curl -XPUT master:9200/customer/external/1?pretty -H'Content-Type: application/json' -d'
> {
>   "name": "John Doe"
> }
> '
{
  "_index" : "customer",
  "_type" : "external",
  "_id" : "1",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "_seq_no" : 0,
  "_primary_term" : 1
}
 
cs



* Elasticsearch 6.0 이후 버전에 도입된 엄격한 content-type 확인으로 인해서 추가해야 합니다.




* 아래와 같은 에러 발생 시

1
2
3
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
 
cs



* 다음과 같이 조치를 취합니다.

1. sysctl.conf

 1-1. sysctl.conf 편집

1
2
$ sudo vi /etc/sysctl.conf
 
cs


 1-2. 내용 추가

1
2
vm.max_map_count=262144
 
cs


 1-3. 확인

1
2
$ sudo sysctl -p
 
cs




* 사전 요구 사항

 > jdk

 > above 2node


* Single Cluster와 설치가 동일하므로 아래 링크를 참고하세요.

 : Elasticsearch 1.6.0 Single Cluster 설치 및 환경 구축



하나의 노드에 설치 및 환경 구축이 끝났다는 가정하에 진행합니다.

1. elasticsearch 디렉터리를 압축

1
2
$ sudo tar -cvzf ./elasticsearch-1.6.0.tar.gz ./elasticsearch-1.6.0
 
cs



2. 압축 파일에 소유 권한 부여

1
2
$ sudo chown -R hadoop-user:hadoop ./elasticsearch-1.6.0.tar.gz
 
cs



3. 클러스터링 된 노드에 압축 파일을 배포

1
2
3
$ scp ./elasticsearch-1.6.0.tar.gz hadoop-user@secondary:~/
elasticsearch-1.6.0.tar.gz                                                         100%   27MB  27.1MB/s   00:00
 
cs

* 해당하는 노드의 수만큼 배포를 진행합니다.

* 위 과정을 진행하려면 아래와 같은 작업이 사전에 요구됩니다.

 : ssh 공개 키 생성 및 분배



4. elasticsearch.yml 설정 파일

 4-1. elasticsearch.yml 편집

  : vi /usr/local/elasticsearch/config/elasticsearch.yml

1
2
$ vi ./config/elasticsearch.yml
 
cs


 4-2. 다음과 같이 cluster.name 부분을 주석 해제하고 이름을 지정합니다.

  : 편집 전

1
2
3
4
5
6
7
################################### Cluster ###################################
 
# Cluster name identifies your cluster for auto-discovery. If you're running
# multiple clusters on the same network, make sure you're using unique names.
#
#cluster.name: elasticsearch
 
cs


  : 편집 후

1
2
3
4
5
6
7
################################### Cluster ###################################
 
# Cluster name identifies your cluster for auto-discovery. If you're running
# multiple clusters on the same network, make sure you're using unique names.
#
cluster.name: elasticsearch
 
cs



5. elasticsearch를 실행합니다.

 : master

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ ./bin/elasticsearch &
[1] 22886
[2018-02-13 10:43:41,405][INFO ][node                     ] [Pietro Maximoff] version[1.6.0], pid[22886], build[cdd3ac4/2015-06-09T13:36:34Z]
[2018-02-13 10:43:41,405][INFO ][node                     ] [Pietro Maximoff] initializing ...
[2018-02-13 10:43:41,409][INFO ][plugins                  ] [Pietro Maximoff] loaded [], sites []
[2018-02-13 10:43:41,451][INFO ][env                      ] [Pietro Maximoff] using [1] data paths, mounts [[/ (/dev/mapper/master--vg-root)]], net usable_space [577.3gb], net total_space [686.4gb], types [ext4]
[2018-02-13 10:43:43,599][INFO ][node                     ] [Pietro Maximoff] initialized
[2018-02-13 10:43:43,599][INFO ][node                     ] [Pietro Maximoff] starting ...
[2018-02-13 10:43:43,725][INFO ][transport                ] [Pietro Maximoff] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/192.168.10.30:9300]}
[2018-02-13 10:43:43,741][INFO ][discovery                ] [Pietro Maximoff] elasticsearch/toriea8LS1CQ8hVPLA-5GQ
[2018-02-13 10:43:47,520][INFO ][cluster.service          ] [Pietro Maximoff] new_master [Pietro Maximoff][toriea8LS1CQ8hVPLA-5GQ][master][inet[/192.168.10.30:9300]], reason: zen-disco-join (elected_as_master)
[2018-02-13 10:43:47,547][INFO ][http                     ] [Pietro Maximoff] bound_address {inet[/0.0.0.0:9200]}, publish_address {inet[/192.168.10.30:9200]}
[2018-02-13 10:43:47,547][INFO ][node                     ] [Pietro Maximoff] started
[2018-02-13 10:43:47,602][INFO ][gateway                  ] [Pietro Maximoff] recovered [0] indices into cluster_state
 
cs


 : secondary

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ ./bin/elasticsearch &
[1] 6831
[2018-02-13 10:45:23,936][INFO ][node                     ] [Titanium Man] version[1.6.0], pid[6831], build[cdd3ac4/2015-06-09T13:36:34Z]
[2018-02-13 10:45:23,936][INFO ][node                     ] [Titanium Man] initializing ...
[2018-02-13 10:45:23,940][INFO ][plugins                  ] [Titanium Man] loaded [], sites []
[2018-02-13 10:45:23,979][INFO ][env                      ] [Titanium Man] using [1] data paths, mounts [[/ (/dev/mapper/secondary--vg-root)]], net usable_space [643.3gb], net total_space [686.4gb], types [ext4]
[2018-02-13 10:45:26,099][INFO ][node                     ] [Titanium Man] initialized
[2018-02-13 10:45:26,099][INFO ][node                     ] [Titanium Man] starting ...
[2018-02-13 10:45:26,314][INFO ][transport                ] [Titanium Man] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/192.168.10.24:9300]}
[2018-02-13 10:45:26,330][INFO ][discovery                ] [Titanium Man] elasticsearch/ZcXCBo3wQjWvuq_MvdKIYA
[2018-02-13 10:45:29,365][INFO ][cluster.service          ] [Pietro Maximoff] added {[Titanium Man][ZcXCBo3wQjWvuq_MvdKIYA][secondary][inet[/192.168.10.24:9300]],}, reason: zen-disco-receive(join from node[[Titanium Man][ZcXCBo3wQjWvuq_MvdKIYA][secondary][inet[/192.168.10.24:9300]]])
[2018-02-13 10:45:29,376][INFO ][cluster.service          ] [Titanium Man] detected_master [Pietro Maximoff][toriea8LS1CQ8hVPLA-5GQ][master][inet[/192.168.10.30:9300]], added {[Pietro Maximoff][toriea8LS1CQ8hVPLA-5GQ][master][inet[/192.168.10.30:9300]],}, reason: zen-disco-receive(from master [[Pietro Maximoff][toriea8LS1CQ8hVPLA-5GQ][master][inet[/192.168.10.30:9300]]])
[2018-02-13 10:45:29,453][INFO ][http                     ] [Titanium Man] bound_address {inet[/0.0.0.0:9200]}, publish_address {inet[/192.168.10.24:9200]}
[2018-02-13 10:45:29,453][INFO ][node                     ] [Titanium Man] started
 
cs

* 클러스터링 여부는 출력 로그의 cluster.service를 통해 확인할 수 있습니다.




* 사전 요구 사항

 > jdk


1. wget을 통해 내려받습니다.

1
2
3
4
5
6
7
8
9
10
11
12
$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz
--2018-02-13 10:05:02--  https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.6.0.tar.gz
Resolving download.elastic.co (download.elastic.co)... 23.21.67.46, 184.72.218.26, 54.225.188.6, ...
Connecting to download.elastic.co (download.elastic.co)|23.21.67.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28401477 (27M) [application/x-tar]
Saving to: ‘elasticsearch-1.6.0.tar.gz’
 
elasticsearch-1.6.0.tar.gz    100%[==============================================>]  27.08M  3.37MB/s    in 9.2s
 
2018-02-13 10:05:12 (2.93 MB/s) - ‘elasticsearch-1.6.0.tar.gz’ saved [28401477/28401477]
 
cs



2. 내려받은 압축 파일을 해제합니다.

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$ tar -xvzf ./elasticsearch-1.6.0.tar.gz
elasticsearch-1.6.0/lib/lucene-core-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-analyzers-common-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-queries-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-memory-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-highlighter-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-queryparser-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-sandbox-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-suggest-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-misc-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-join-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-grouping-4.10.4.jar
elasticsearch-1.6.0/lib/lucene-spatial-4.10.4.jar
elasticsearch-1.6.0/lib/spatial4j-0.4.1.jar
elasticsearch-1.6.0/lib/lucene-expressions-4.10.4.jar
elasticsearch-1.6.0/lib/antlr-runtime-3.5.jar
elasticsearch-1.6.0/lib/asm-4.1.jar
elasticsearch-1.6.0/lib/asm-commons-4.1.jar
elasticsearch-1.6.0/lib/jts-1.13.jar
elasticsearch-1.6.0/lib/groovy-all-2.4.0.jar
elasticsearch-1.6.0/lib/log4j-1.2.17.jar
elasticsearch-1.6.0/lib/apache-log4j-extras-1.2.17.jar
elasticsearch-1.6.0/lib/jna-4.1.0.jar
elasticsearch-1.6.0/lib/elasticsearch-1.6.0.jar
elasticsearch-1.6.0/README.textile
elasticsearch-1.6.0/LICENSE.txt
elasticsearch-1.6.0/NOTICE.txt
elasticsearch-1.6.0/config/elasticsearch.yml
elasticsearch-1.6.0/config/logging.yml
elasticsearch-1.6.0/bin/plugin.bat
elasticsearch-1.6.0/bin/elasticsearch.in.bat
elasticsearch-1.6.0/bin/elasticsearch.bat
elasticsearch-1.6.0/bin/service.bat
elasticsearch-1.6.0/bin/elasticsearch-service-x64.exe
elasticsearch-1.6.0/bin/elasticsearch-service-mgr.exe
elasticsearch-1.6.0/bin/elasticsearch-service-x86.exe
elasticsearch-1.6.0/bin/elasticsearch
elasticsearch-1.6.0/bin/plugin
elasticsearch-1.6.0/bin/elasticsearch.in.sh
elasticsearch-1.6.0/lib/sigar/sigar-x86-winnt.lib
elasticsearch-1.6.0/lib/sigar/libsigar-universal64-macosx.dylib
elasticsearch-1.6.0/lib/sigar/libsigar-amd64-linux.so
elasticsearch-1.6.0/lib/sigar/libsigar-universal-macosx.dylib
elasticsearch-1.6.0/lib/sigar/sigar-1.6.4.jar
elasticsearch-1.6.0/lib/sigar/libsigar-sparc-solaris.so
elasticsearch-1.6.0/lib/sigar/libsigar-x86-freebsd-5.so
elasticsearch-1.6.0/lib/sigar/libsigar-amd64-freebsd-6.so
elasticsearch-1.6.0/lib/sigar/sigar-amd64-winnt.dll
elasticsearch-1.6.0/lib/sigar/libsigar-x86-linux.so
elasticsearch-1.6.0/lib/sigar/libsigar-ia64-linux.so
elasticsearch-1.6.0/lib/sigar/libsigar-x86-solaris.so
elasticsearch-1.6.0/lib/sigar/libsigar-amd64-solaris.so
elasticsearch-1.6.0/lib/sigar/libsigar-x86-freebsd-6.so
elasticsearch-1.6.0/lib/sigar/sigar-x86-winnt.dll
elasticsearch-1.6.0/lib/sigar/libsigar-sparc64-solaris.so
 
cs



3. 적절한 위치에 배치합니다.

1
2
$ sudo mv ./elasticsearch-1.6.0 /usr/local/
 
cs



4. 해당 계정에 소유 권한을 부여합니다.

1
2
$ sudo chown -R hadoop-user:hadoop ./elasticsearch-1.6.0/
 
cs



5. 링크를 생성합니다.

1
2
$ sudo ln -sf ./elasticsearch-1.6.0 ./elasticsearch
 
cs



6. elasticsearch를 실행합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ ./bin/elasticsearch
[2018-02-13 10:08:49,563][INFO ][node                     ] [Bizarnage] version[1.6.0], pid[21619], build[cdd3ac4/2015-06-09T13:36:34Z]
[2018-02-13 10:08:49,564][INFO ][node                     ] [Bizarnage] initializing ...
[2018-02-13 10:08:49,568][INFO ][plugins                  ] [Bizarnage] loaded [], sites []
[2018-02-13 10:08:49,616][INFO ][env                      ] [Bizarnage] using [1] data paths, mounts [[/ (/dev/mapper/master--vg-root)]], net usable_space [577.4gb], net total_space [686.4gb], types [ext4]
[2018-02-13 10:08:51,758][INFO ][node                     ] [Bizarnage] initialized
[2018-02-13 10:08:51,759][INFO ][node                     ] [Bizarnage] starting ...
[2018-02-13 10:08:51,915][INFO ][transport                ] [Bizarnage] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/192.168.10.30:9300]}
[2018-02-13 10:08:51,933][INFO ][discovery                ] [Bizarnage] elasticsearch/rLQ-PaiFQh-_mVQUzHPfqQ
[2018-02-13 10:08:55,714][INFO ][cluster.service          ] [Bizarnage] new_master [Bizarnage][rLQ-PaiFQh-_mVQUzHPfqQ][master][inet[/192.168.10.30:9300]], reason: zen-disco-join (elected_as_master)
[2018-02-13 10:08:55,757][INFO ][http                     ] [Bizarnage] bound_address {inet[/0.0.0.0:9200]}, publish_address {inet[/192.168.10.30:9200]}
[2018-02-13 10:08:55,757][INFO ][node                     ] [Bizarnage] started
[2018-02-13 10:08:55,807][INFO ][gateway                  ] [Bizarnage] recovered [0] indices into cluster_state
 
cs



7. 해당 포트를 확인하여 정상 동작을 하는지 확인합니다.

1
2
3
4
5
$ netstat -ntpl |grep 9200
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:9200            0.0.0.0:*               LISTEN      21619/java
 
cs



8. elasticsearch가 제공하는 REST API를 통해 정상 동작 여부를 확인합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ curl 'http://master:9200/?pretty'
{
  "status" : 200,
  "name" : "Bizarnage",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.6.0",
    "build_hash" : "cdd3ac4dde4f69524ec0a14de3828cb95bbb86d0",
    "build_timestamp" : "2015-06-09T13:36:34Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}
 
cs



9. elasticsearch 서비스 종료

1
2
3
4
5
6
7
8
9
10
11
12
$ curl -XPOST 'http://master:9200/_shutdown'
[2018-02-13 10:41:58,143][INFO ][action.admin.cluster.node.shutdown] [Andreas von Strucker] [cluster_shutdown]: requested, shutting down in [1s]
{"cluster_name":"elasticsearch","nodes":{"CY_d5xZlRRaJi-WeQ_sKMw":{"name":"Andreas von Strucker"}}}hadoop-user@master:/usr/local/elasticsearch$ [2018-02-13 10:41:59,145][INFO ][action.admin.cluster.node.shutdown] [Andreas von Strucker] [cluster_shutdown]: done shutting down all nodes except master, proceeding to master
[2018-02-13 10:41:59,151][INFO ][action.admin.cluster.node.shutdown] [Andreas von Strucker] shutting down in [200ms]
[2018-02-13 10:41:59,353][INFO ][action.admin.cluster.node.shutdown] [Andreas von Strucker] initiating requested shutdown...
[2018-02-13 10:41:59,353][INFO ][node                     ] [Andreas von Strucker] stopping ...
[2018-02-13 10:41:59,379][INFO ][node                     ] [Andreas von Strucker] stopped
[2018-02-13 10:41:59,380][INFO ][node                     ] [Andreas von Strucker] closing ...
[2018-02-13 10:41:59,386][INFO ][node                     ] [Andreas von Strucker] closed
 
[1]+  Done                    ./bin/elasticsearch
 
cs



+ Recent posts