Setting vm.max_map_count to at least 262144 before running Dockerfile.

Hello everyone, i’m trying to launch my Elasticsearch Docker file on the Fly. The thing is that Elasticsearch Docker has curtains conditions before running its instance such as setting the vm.max_map_count=262144 for it to function properly. I have tried it making it work using RUN command but it showed permission denied. Is there any other workaround for this? Thanks in advance!!

Hey there,

What platform are you running this on? Is in linux, macOS, windows, etc?

I was looking into the documentation a bit and saw there’s a few different ways to set the vm.max_map_count depending on the platform you are using. Here’s the link to what I was looking at-Install Elasticsearch with Docker | Elasticsearch Guide [7.5] | Elastic

Okay so i have the Dockerfile to deploy the elasticsearch. This is the one:

FROM elasticsearch:8.8.1
ENV node.name="es01"
ENV ES_JAVA_OPTS="-Xms1g -Xmx1g"
EXPOSE 9200
EXPOSE 9300

The thing is that when i load it on the Fly.io it is gicing these errors:

So to make them work i have to set these system configurations on fly.io.

You’re right about you needing to set some system configurations. It looks like this is all needing to be done within Elasticsearch. All those checks (the 4 checks it references) are all within elasticsearch’s documentation, and it seems as though all need to be configured properly for production.

  1. File Descriptors | Elasticsearch Guide [7.5] | Elastic
  2. Install Elasticsearch with Docker | Elasticsearch Guide [7.5] | Elastic
  3. Discovery | Elasticsearch Guide [7.5] | Elastic
  4. Common SSL/TLS exceptions | Elasticsearch Guide [7.5] | Elastic

Hope this helps!

Thanks a lot for your reply… i went through them and changed all of the settings. It is working now.

But there is something else i want to ask, my elasticsearch app is working over https protocol, but whenever i send request to it the console for the machines show this:

As i understand what is happening is that i send https request to Fly, it receives them and sends a request to elasticsearch client over http but the thing is elasticsearch receives request over https that’s why it is not working… is it a correct assumption? If it is how can i fix fly proxy to send https requests to elastic search??

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.