From ada5007a8e99fbfbe219c229896c136675480d08 Mon Sep 17 00:00:00 2001 From: Yik Teng Hie Date: Tue, 21 Jun 2022 14:36:25 +0800 Subject: [PATCH] fix elasticsearch instance startup issue --- elasticsearch/README.md | 16 ++++++++++++++-- elasticsearch/docker-compose.yml | 9 +++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 6a03d7f..f6de04c 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -1,7 +1,5 @@ # Setup Elasticsearch - - - For single node setup - [Reference](https://www.elastic.co/guide/en/kibana/8.2/docker.html) ```shell @@ -34,4 +32,18 @@ $ docker-compose down # Remove all volume and network $ docker-compose down -v +``` + +## Fixes + +- [Virtual Memory Issue] (https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html) + +```shell +# use --ulimit nofile=65536:65536 to fix issue#1 +$ docker run --ulimit nofile=65536:65536 -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk + + +# Temporary fix virtual memory issue +$ sysctl -w vm.max_map_count=262144 + ``` \ No newline at end of file diff --git a/elasticsearch/docker-compose.yml b/elasticsearch/docker-compose.yml index 0d26df7..3dc7175 100644 --- a/elasticsearch/docker-compose.yml +++ b/elasticsearch/docker-compose.yml @@ -94,6 +94,9 @@ services: - xpack.license.self_generated.type=${LICENSE} mem_limit: ${MEM_LIMIT} ulimits: + nofile: + soft: 65536 + hard: 65536 memlock: soft: -1 hard: -1 @@ -134,6 +137,9 @@ services: - xpack.license.self_generated.type=${LICENSE} mem_limit: ${MEM_LIMIT} ulimits: + nofile: + soft: 65536 + hard: 65536 memlock: soft: -1 hard: -1 @@ -174,6 +180,9 @@ services: - xpack.license.self_generated.type=${LICENSE} mem_limit: ${MEM_LIMIT} ulimits: + nofile: + soft: 65536 + hard: 65536 memlock: soft: -1 hard: -1