본문 바로가기

리눅스

ubuntu 환경에서 elasticsearch와 kibana를 설치하는 방법

반응형

ubuntu 환경에서 elasticsearch와 kibana를 설치하는 방법(7.x)

APT 저장소 업데이트

sudo apt-get update
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install -y apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update

Elasticsearch 설치

sudo apt-get install -y elasticsearch
$ cat /etc/elasticsearch/elasticsearch.yml | egrep -v '^$|^#'
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

elasticsearch.yml 설정 파일 편집

vim /etc/elasticsearch/elasticsearch.yml
  • cluster.name: my-application
  • node.name: node-1
  • path.data: /var/lib/elasticsearch
  • path.logs: /var/log/elasticsearch
  • network.host: 0.0.0.0
  • http.port: 9200
  • discovery.seed_hosts: ["node-1"]
  • cluster.initial_master_nodes: ["node-1"]
$ cat /etc/elasticsearch/elasticsearch.yml | egrep -v '^$|^#'
cluster.name: my-application
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["node-1"]
cluster.initial_master_nodes: ["node-1"]

Elasticsearch 실행

systemctl --now enable elasticsearch
curl -s http://127.0.0.1:9200 | jq
$ curl -s http://127.0.0.1:9200 | jq
{
  "name": "es-01",
  "cluster_name": "elasticsearch",
  "cluster_uuid": "tHlwG-jITz-9T_LClkm2yw",
  "version": {
    "number": "7.17.9",
    "build_flavor": "default",
    "build_type": "deb",
    "build_hash": "ef48222227ee6b9e70e502f0f0daa52435ee634d",
    "build_date": "2023-01-31T05:34:43.305517834Z",
    "build_snapshot": false,
    "lucene_version": "8.11.1",
    "minimum_wire_compatibility_version": "6.8.0",
    "minimum_index_compatibility_version": "6.0.0-beta1"
  },
  "tagline": "You Know, for Search"
}

Kibana 설치

sudo apt-get install -y kibana
$ cat /etc/kibana/kibana.yml | egrep -v '^$|^#'

kibana.yml 설정 파일 편집

vim /etc/kibana/kibana.yml
  • server.port: 5601
  • server.host: "0.0.0.0"
  • elasticsearch.hosts: ["http://localhost:9200"]
$ cat /etc/kibana/kibana.yml | egrep -v '^$|^#'
server.port: 5601
elasticsearch.hosts: ["http://localhost:9200"]

Kibana 실행

systemctl --now enable kibana

Elasticsearch : http://localhost:9200

Kibana : http://localhost:5601

728x90
반응형