* 사전 요구 사항

 > 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를 통해 확인할 수 있습니다.



+ Recent posts