windows10 기준
required: wsl2, docker, docker-compose
사용법
version: '3.4'
services:
# 컨테이너 1개당 노드 1개
# es01 컨테이너는 se01 노드를 관리합니다.
es01:
# 가끔 키바나, 엘라스틱 버젼이 맞지 않는 경우 키바나 연결이 안되는 에러 있다고 합니다.
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
container_name: es01
# 노드 환경 설정
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02
- cluster.initial_master_nodes=es01,es02
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- http.cors.enabled=true
ulimits:
# 디스크 <-> 램 메모리 스왑 방지 ...
memlock:
soft: -1
hard: -1
volumes:
- data01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
container_name: es02
environment:
- node.name=es02
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es01
- cluster.initial_master_nodes=es01,es02
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- http.cors.enabled=true
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- data02:/usr/share/elasticsearch/data
networks:
- elastic
kib01:
image: docker.elastic.co/kibana/kibana:7.12.1
container_name: kib01
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://es01:9200
ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200"]'
networks:
- elastic
volumes:
data01:
driver: local
data02:
driver: local
data03:
driver: local
networks:
elastic:
driver: bridge # use bridege pluggin
1) wsl -d docker-desktop
2) sysctl -w vm.max_map_count=262144
docker-compose -f docker-elasticsearch.yml up
4 키바나에서 샘플 데이터 다운