os : centos 7.x

 

@Elasticsearch PGP KEY 추가

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

 

@RPM repository 추가

vi /etc/yum.repos.d/elasticsearch.repo

 

[elasticsearch]

name=Elasticsearch repository for 7.x packages

baseurl=https://artifacts.elastic.co/packages/7.x/yum

gpgcheck=1

gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch

enabled=0

autorefresh=1

type=rpm-md

 

@rpm 설치

yum install --enablerepo=elasticsearch elasticsearch

 

@systemd등록 -> 부팅시 자동 실행

chkconfig --add elasticsearch

systemctl daemon-reload

systemctl enable elasticsearch.service

 

@memory , file unlimited 설정

vi /etc/security/limits.conf

elasticsearch hard memlock unlimited
elasticsearch soft memlock unlimited
elasticsearch hard nofile 65536
elasticsearch soft nofile 65536
elasticsearch hard nproc 65536
elasticsearch soft nproc 65536

 

@서비스 시작시 memory lock -> 무한 설정

vi /usr/lib/systemd/system/elasticsearch.service

[Service]

LimitMEMLOCK=infinity <-- 추가

 

위 설정을 하지 않는다면

memory locking requested for elasticsearch process but memory is not locked 

오류가 발생 할 수 있음

 

@환경설정

vi  /etc/elasticsearch/elasticsearch.yml

최초 구동을 위해서는 아래 3가지는 반드시 설정 해줘야함 

node.name:master

discovery.seed_hosts: ["192.168.0.50","::1"]  <-- 서버 아이피 설정

cluster.initial_master_nodes: ["master"]  <-- 마스터 노드명

 

위 설정을 하지 않는다면

 the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured

 

 

@실행 / 종료

start : service elasticsearch start

end :  service elasticsearch stop

 

[참조] www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html

반응형
블로그 이미지

visualp

c#, java

,