• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Elasticsearch, Kibana 설치 & 설정

09 Nov 2017

Reading time ~1 minute

Elasticsearch, Kibana 설치 & 설정

Elasticsearch는 분산형 RESTful 검색 및 분석 엔진입니다.

  • 기본 개념
    1. NRT(Near Realtime) - 검색 플랫폼
    2. 클러스터 - 하나 이상의 노드(서버)가 모인것
    3. 노드 - 클러스터에 포함된 단일 서버
    4. 인덱스 - 비슷한 특성을 가진 문서 모음
    5. 타입 - 색인에서 지정하는 유형
    6. 도큐먼트 - 문서의 색인화의 기본단위
    7. 샤드 & 리플리카
    • 샤드 => 색인을 조각으로 분할
    • 리플리카 => 샤드의 복제

Elasticsearch 설치

  • 최소 사양-ORACLE JDK 8이상
  1. 기본 시스템 설정 처리
  2. elasticsearch download
  3. 압축 해제
    tar -xvf elasticsearch-5.x.x.tar.gz
    
  4. 설정 변경
    vim  $INSTALL_PATH/config/elasticsearch.yml
    # 외부 접속 IP로 변경
    network.host: {IP}
    
  5. 실행
    $INSTALL_PATH/bin/elasticsearch
    

Elasticsearch API

클러스터 상태 확인

curl -XGET localhost:9200/{index 명}/_cat/health?v

노드 목록 확인

curl -XGET localhost:9200/{index 명}/_cat/nodes?v

모든 INDEX 나열

curl -XGET localhost:9200/{index 명}/_cat/indices?v

INDEX 생성(mappings.json 샘플)

curl -XPUT -i "localhost:9200/{index 명}/" -H 'Content-Type: application/json' -d "{@./mappings.json}"

INDEX FIELD 확인

curl -XGET localhost:9200/{index 명}/_settings,_mappings?pretty

INDEX 삭제

curl -XDELETE localhost:9200/{index 명} -H "Accept: application/json"

Kibans 설치

  1. Kibana download
  2. 압축 해제
    tar -xvf kibana-5.x.x-linux-x86_64.tar.gz
    
  3. 설정 변경
    vim $INSTALL_PATH/config/kibana.yml
    # 변경내역
    # server.host 외부에서 접근하기 위하여 0.0.0.0 으로 설정
    server.host: "0.0.0.0"
    # elasticsearch url 설정
    elasticsearch.url: "http://10.0.2.15:9200"
    
  4. 실행
    $INSTALL_PATH/bin/kibana
    
  5. web 접속
    http://ADDRESS:5601
    
  6. INDEX Pattern 설정 후 결과 보기

참고 자료

  1. Elasticsearch Reference
  2. Elasticsearch Reference 5.4 한글판


elasticsearchkibana Share Tweet +1