본문 바로가기
미들웨어/ElasticSearch

RPM을 이용해 Elasticsearch를 설치해보자.

by leedonggeun 2023. 9. 22.

개요

이번 게시글에서는 엘라스틱서치 8.x (stable) 버전을 RPM(dnf/yum)으로 설치하는 방법에 대해 기술합니다.

1. Elasticsearch GPG Key import

엘라스틱서치 서명키를 받습니다.

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

2. Elasticsearch repository 추가하기

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

[elasticsearch]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md


:wq

3. Elasticsearch 설치하기

dnf install --enablerepo=elasticsearch elasticsearch

Last metadata expiration check: 0:00:32 ago on Fri 22 Sep 2023 03:13:34 PM KST.
Dependencies resolved.
===============================================================================================================================================================================================================================================================================
 Package                                                              Architecture                                                  Version                                                         Repository                                                            Size
===============================================================================================================================================================================================================================================================================
Installing:
 elasticsearch                                                        x86_64                                                        8.10.2-1                                                        elasticsearch                                                        579 M

Transaction Summary
===============================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 579 M
Installed size: 1.2 G
Is this ok [y/N]:

4. Daemon 활성화 및 시작

systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service

systemctl status elasticsearch.service

● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2023-09-22 15:22:40 KST; 1min 24s ago
     Docs: https://www.elastic.co
 Main PID: 6783 (java)
    Tasks: 66 (limit: 23079)
   Memory: 2.1G
   CGroup: /system.slice/elasticsearch.service
           ├─6783 /usr/share/elasticsearch/jdk/bin/java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=/usr/share/elasticsearch/bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -D>
           ├─6864 /usr/share/elasticsearch/jdk/bin/java -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTrac>
           └─6884 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Sep 22 15:22:21 ${server-name} systemd[1]: Starting Elasticsearch...
Sep 22 15:22:40 ${server-name} systemd[1]: Started Elasticsearch.

5. 서비스 정상 동작 확인

정상적으로 엘라스틱서치를 설치했다면, 설치 후 The generated password for the elastic built-in superuser is : ~~~
하고 비밀번호가 표시되었을 겁니다. 그 비밀번호를 아래의 ${ELASTIC_PASSWORD}로 대치하여 확인합니다.

curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:${ELASTIC_PASSWORD} https://localhost:9200

{
  "name" : "${server-name}",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "${cluster-uuid}",
  "version" : {
    "number" : "8.10.2",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "${build_hash}",
    "build_date" : "2023-09-19T08:16:24.564900370Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

 

 

참고

https://www.elastic.co/guide/en/elasticsearch/reference/8.10/rpm.html

 

Install Elasticsearch with RPM | Elasticsearch Guide [8.10] | Elastic

Startup timeouts with older systemd versions By default Elasticsearch sets the TimeoutStartSec parameter to systemd to 900s. If you are running at least version 238 of systemd then Elasticsearch can automatically extend the startup timeout, and will do so

www.elastic.co

 

'미들웨어 > ElasticSearch' 카테고리의 다른 글

Elasticsearch에 대해 가볍게 알아보자.  (0) 2023.08.20

댓글