본문으로 바로가기
 

오픈소스 검색 및 분석· Elasticsearch | Elastic

Elasticsearch 시작하기 실시간 데이터 분석과 검색을 경험해 보세요.

www.elastic.co

 

Install Elasticsearch with Debian Package | Elasticsearch Reference [7.8] | Elastic

On systemd-based distributions, the installation scripts will attempt to set kernel parameters (e.g., vm.max_map_count); you can skip this by masking the systemd-sysctl.service unit.

www.elastic.co

 

Elasticsearch 란?

  • 일래스틱서치(Elasticsearch)는 루씬 기반의 검색 엔진이다.
  • HTTP 웹 인터페이스와 스키마에서 자유로운 JSON 문서와 함께 분산 멀티테넌트 지원 전문 검색 엔진을 제공한다. 
  • 일래스틱서치는 자바로 개발되어 있으며 아파치 라이선스 조항에 의거하여 오픈 소스로 출시되어 있다.

 

APT repository 를 이용한 설치

우분투 18.04 에 일레스틱서치 7.8 버전을 설치할 것입니다.

(base) jvv@dev:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic

 

 

Import the Elasticsearch PGP Key

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

 

필요한 패키지

sudo apt-get install apt-transport-https

 

Elasticsearch repository 등록

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

 

설치

sudo apt-get update && sudo apt-get install elasticsearch
받기:1 http://storage.googleapis.com/bazel-apt stable InRelease [2,256 B]
오류:1 http://storage.googleapis.com/bazel-apt stable InRelease                                                                                                       
  다음 서명이 올바르지 않습니다: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com>
받기:2 https://artifacts.elastic.co/packages/7.x/apt stable InRelease [10.4 kB]                                                                                       
받기:3 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 Packages [38.2 kB]                                                                             
기존:4 https://packages.microsoft.com/repos/vscode stable InRelease                                                                                                   
무시:5 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease                                                                                           
무시:6 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 InRelease                                                                                           
기존:7 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                                                    
기존:8 http://kr.archive.ubuntu.com/ubuntu bionic InRelease                                                                                                           
기존:9 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release                                                                                             
기존:10 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 Release                                                                                            
기존:11 http://kr.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                           
받기:14 https://artifacts.elastic.co/packages/7.x/apt stable/main i386 Packages [31.0 kB]                                                       
기존:15 http://kr.archive.ubuntu.com/ubuntu bionic-backports InRelease                                              
기존:16 https://repo.grakn.ai/repository/apt trusty InRelease                 
내려받기 79.6 k바이트, 소요시간 2초 (49.9 k바이트/초)
패키지 목록을 읽는 중입니다... 완료
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://storage.googleapis.com/bazel-apt stable InRelease: 다음 서명이 올바르지 않습니다: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com>
W: http://storage.googleapis.com/bazel-apt/dists/stable/InRelease 파일을 받는데 실패했습니다  다음 서명이 올바르지 않습니다: EXPKEYSIG 3D5919B448457EE0 Bazel Developer (Bazel APT repository key) <bazel-dev@googlegroups.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:
  libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libsnappy1v5 libtcmalloc-minimal4 libyaml-cpp0.5v5 linux-headers-5.3.0-61
  linux-headers-5.3.0-61-generic linux-image-5.3.0-61-generic linux-modules-5.3.0-61-generic linux-modules-extra-5.3.0-61-generic zlib1g-dev
Use 'sudo apt autoremove' to remove them.
다음 새 패키지를 설치할 것입니다:
  elasticsearch
0개 업그레이드, 1개 새로 설치, 0개 제거 및 94개 업그레이드 안 함.
319 M바이트 아카이브를 받아야 합니다.
이 작업 후 532 M바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 https://artifacts.elastic.co/packages/7.x/apt stable/main amd64 elasticsearch amd64 7.8.0 [319 MB]
내려받기 319 M바이트, 소요시간 2분 20초 (2,279 k바이트/초)                                                                                                            
Selecting previously unselected package elasticsearch.
(데이터베이스 읽는중 ...현재 257290개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../elasticsearch_7.8.0_amd64.deb ...
Creating elasticsearch group... OK
Creating elasticsearch user... OK
Unpacking elasticsearch (7.8.0) ...
elasticsearch (7.8.0) 설정하는 중입니다 ...
Created elasticsearch keystore in /etc/elasticsearch/elasticsearch.keystore
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.39) ...

 

패키지를 다운로드하여 설치

 

Download Elasticsearch Free | Get Started Now | Elastic | Elastic

Want it hosted? Deploy on Elastic Cloud. Get Started »

www.elastic.co

 

우클릭 - 링크 주소복사

 

복사한 링크를 wget 명령어를 이용하여 다운로드 진행 후, dpkg -i 명령어로 해당 패키지를 설치합니다.

sha512 는 무결성 체크.

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.0-amd64.deb
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.0-amd64.deb.sha512
shasum -a 512 -c elasticsearch-7.8.0-amd64.deb.sha512 
sudo dpkg -i elasticsearch-7.8.0-amd64.deb

 

실행

서비스를 시작하고 확인해봅니다.

elasticsearch 의 default port 는 9200 입니다.

curl -X GET localhost:9200

jvv@dev:~$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://www.elastic.co
jvv@dev:~$ 
jvv@dev:~$ sudo systemctl start elasticsearch
jvv@dev:~$ 
jvv@dev:~$ curl -X GET localhost:9200
{
  "name" : "dev",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "VwEer7NWSEefMi9XeBpEFQ",
  "version" : {
    "number" : "7.8.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "757314695644ea9a1dc2fecd26d1a43856725e65",
    "build_date" : "2020-06-14T19:35:50.234439Z",
    "build_snapshot" : false,
    "lucene_version" : "8.5.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}