# Setup Elasticsearch - For single node setup - [Reference](https://www.elastic.co/guide/en/kibana/8.2/docker.html) ```shell # create docker elastic network $ docker network create elastic # Start elasticsearch $ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.2.3 $ docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.2.3 # start kibana $ docker pull docker.elastic.co/kibana/kibana:8.2.3 $ docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.2.3 # remove $ docker network rm elastic $ docker rm es-node01 $ docker rm kib-01 ``` - For multinode elasticsearch setup - [Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) ```shell # start multi-node elasticsearch $ docker-compose up -d # stop elasticsearch $ 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 ```