Skip to content

Instantly share code, notes, and snippets.

@ma-he-sh
Last active August 30, 2020 00:52
Show Gist options
  • Save ma-he-sh/a607e976ec03cbb56cf26c6290de340d to your computer and use it in GitHub Desktop.
Save ma-he-sh/a607e976ec03cbb56cf26c6290de340d to your computer and use it in GitHub Desktop.
ElasticSearch and Kibana
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.0
container_name: elasticsearch
restart: unless-stopped
environment:
- "network.host=0.0.0.0"
- "http.port=9200"
- "cluster.name=elasticsearch"
- "node.name=wpdata"
- "node.master=true"
- "node.data=true"
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 4g
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- esnet
kib01:
image: docker.elastic.co/kibana/kibana:7.5.0
container_name: kib01
ports:
- 5601:5601
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
networks:
- esnet
volumes:
esdata:
driver: local
networks:
esnet:

// check logs to debug

docker logs --tail 50 --follow <containerID>

// bash on docker

docker exec -it <containerID> /bin/bash

// fix for virt. memory issue

sudo sysctl -w vm.max_map_count=262144 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment