Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
361 views
in Technique[技术] by (71.8m points)

Elasticsearch docker container in non-prod mode to eliminate vm.max_map_count=262144 requirement

How can I configure elasticsearch docker containers (elasticsearch:7.5.0) to use fewer resources and run in a nonproduction mode?

I want to run containers in Jenkins and on my desktop and am hitting the requirement from this elastic doc for running docker images in production

I'd like to figure out how I can modify my elasticsearch.yml which I copy into the container to configure it to set the container into a less resource-intensive mode.

anyone know how to do this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can run your docker in development mode and create a single node ES cluster by following official ES link on single node ES cluster. As mention in this link.

To start a single-node Elasticsearch cluster for development or testing, specify single-node discovery to bypass the bootstrap checks:

In-short all you need to do is add -e "discovery.type=single-node" in your docker command, which would enable the dev mode and then you don't have to satisfy the hard limits of production environments ie it bypass bootstrap checks.

More information on your settings and how to turn it off can be found here

node.store.allow_mmap. This is a boolean setting indicating whether or not memory-mapping is allowed. The default is to allow it.

So, if -e "discovery.type=single-node env. doesn't turn it off, then you can explicitly set it false in your elasticsearch.yml.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...