Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kesor
Last active July 13, 2020 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kesor/f27210697b79ba4aefe2902d7beb11a1 to your computer and use it in GitHub Desktop.
Save kesor/f27210697b79ba4aefe2902d7beb11a1 to your computer and use it in GitHub Desktop.
Docker Compose for ElasticSearch + Kibana 7.8
# Create an EBS volume and attach to the EC2 instance
# Format as XFS and mount at /mnt/elastic-data
# /dev/nvme2n1 on /mnt/elastic-data type xfs (rw,relatime,attr2,inode64,noquota)
# For ElasticSearch to work - got to change this sysctl:
#
# sudo sysctl vm.max_map_count=262144
#
# $ cat docker-compose.yml
version: "3.7"
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes=es01
- bootstrap.memory_lock=true
- http.cors.enabled=true
- http.cors.allow-origin=*
- "ES_JAVA_OPTS=-Xms3g -Xmx3g"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 98304
hard: 98304
volumes:
- /mnt/elastic-data:/usr/share/elasticsearch/data
ports:
- 9200:9200
kibana:
init: true
image: docker.elastic.co/kibana/kibana:7.8.0
ports:
- 5601:5601
# volumes:
# - ./kibana.yml:/usr/share/kibana/config/kibana.yml
# volumes:
# elastic_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment