Open Distro for Elasticsearch setup with Docker

hansung.dev·2021년 5월 4일
0

Docker-Compose를 사용하여 "OpenDistro for Elasticsearch"를 구축합니다.

Getting Started

실습 환경 정보는 아래와 같습니다.

OpenDistro for Elasticsearch : 1.13.2
OpenDistro for kibana : 1.13.2
OS : macOS Big Sur Ver 11.2.2
Docker : 20.10.2, Docker Compose : 1.27.4, build 40524192

File Directory with Docker-Compose

opendistro-for-elasticsearch:1.13.2
└── docker-compose.yml

docker-compose.yml

version: '3'
services:
  odfe-node1:
    image: amazon/opendistro-for-elasticsearch:1.13.2
    container_name: odfe-node1
    environment:
      - cluster.name=odfe-cluster
      - node.name=odfe-node1
      - discovery.seed_hosts=odfe-node1,odfe-node2
      - cluster.initial_master_nodes=odfe-node1,odfe-node2
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the Elasticsearch user, set to at least 65536 on modern systems
        hard: 65536
    volumes:
      - odfe-data1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9600:9600 # required for Performance Analyzer
    networks:
      - odfe-net
  odfe-node2:
    image: amazon/opendistro-for-elasticsearch:1.13.2
    container_name: odfe-node2
    environment:
      - cluster.name=odfe-cluster
      - node.name=odfe-node2
      - discovery.seed_hosts=odfe-node1,odfe-node2
      - cluster.initial_master_nodes=odfe-node1,odfe-node2
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - odfe-data2:/usr/share/elasticsearch/data
    networks:
      - odfe-net
  kibana:
    image: amazon/opendistro-for-elasticsearch-kibana:1.13.2
    container_name: odfe-kibana
    ports:
      - 5601:5601
    expose:
      - "5601"
    environment:
      ELASTICSEARCH_URL: https://odfe-node1:9200
      ELASTICSEARCH_HOSTS: https://odfe-node1:9200
    networks:
      - odfe-net

volumes:
  odfe-data1:
  odfe-data2:

networks:
  odfe-net:

Install and Configure Docker : https://opendistro.github.io/for-elasticsearch-docs/docs/install/docker/

Setting up and running

Docker-Compos Run, Stop

docker-compose를 실행하여 Elasticsearch, Kibana를 시작합니다.

# run
docker-compose up -d

#stop
docker-compose stop

Connecting to OpenDistro for Elasticsearch

"http://localhost:5601/"로 kibana에 접근합니다. username, password를 admin / admin 으로 입력합니다.

kibana에 정상적으로 접근이 됩니다.

다음 시간에는 OpenDistro for Elasticsearch의 "Anomaly Detection" 기능에 대해서 실습을 통해 알아보겠습니다.

profile
Data Engineer

0개의 댓글