ubuntu 20.04에 elasticsearch 설치
1) 보안키 서명
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
2) apt에 리스트 추가
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
3) apt update
sudo apt update
4) 설치
sudo apt install elasticsearch
5) 설정
sudo vi /etc/elasticsearch/elasticsearch.yml
- 아직 node설정이 하나밖에 안되어있지만 node들으르 분사으로 추가 할 수 있다.
cluster.name: my-application
node.name: node-1
node.master: true
node.data: true
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9201
transport.tcp.port: 9301
discovery.seed_hosts: ["127.0.0.1:9301"]
cluster.initial_master_nodes: ["node-1"]
discovery.zen.minimum_master_nodes: 1
6) 실행
service elasticsearch start
7) 확인
service elasticsearch status
elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-07-24 02:19:52 KST; 7min ago
Docs: https://www.elastic.co
curl -XGET 127.0.0.1:9201
{
"name" : "node-1",
"cluster_name" : "my-application",
"cluster_uuid" : "3sf6bw6CQGeLW7XJpa2-2Q",
"version" : {
"number" : "7.13.4",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "c5f60e894ca0c61cdbae4f5a686d9f08bcefc942",
"build_date" : "2021-07-14T18:33:36.673943207Z",
"build_snapshot" : false,
"lucene_version" : "8.8.2",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
reference
https://velog.io/@qnfmtm666/elasticsearch-Elasticsearch-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-Ubuntu-20.04