* 사전 요구 사항

 > 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