Created
August 8, 2021 20:17
-
-
Save alphamarket/f07d1900e58eef694bf56896849107f2 to your computer and use it in GitHub Desktop.
Install and use ElasticSearch with limited resources using docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# follow `https://www.elastic.co/guide/en/kibana/current/docker.html#run-kibana-on-docker-for-dev` instructions for | |
# installing ES using docker | |
function run-docker-es() { | |
# remove any already running es instance | |
docker ps -af "name=elasticsearch" -q 2>/dev/null | xargs docker rm &>/dev/null | |
# launch the ES with 1GB memory limit and 3 core | |
docker run --name elasticsearch \ | |
--net elastic \ | |
-p 9200:9200 \ | |
-p 9300:9300 \ | |
-e "discovery.type=single-node" \ | |
-e ES_JAVA_OPTS="-Xms1g -Xmx1g" \ | |
--memory 1g \ | |
--memory-swap -1 \ | |
--cpus 3 docker.elastic.co/elasticsearch/elasticsearch:7.14.0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment