Docker max virtual memory areas vm.max_map_count is too low,

Hello,

what is the correct way to add the following settings to my container

"vm.max_map_count=262144"

I've added to my project the Official dockerfile

Then i added the following line on the dockerfile without success:

# Replace OpenJDK's built-in CA certificate keystore with the one from the OS
# vendor. The latter is superior in several ways.
# REF: https://github.com/elastic/elasticsearch-docker/issues/171
RUN ln -sf /etc/pki/ca-trust/extracted/java/cacerts /usr/share/elasticsearch/jdk/lib/security/cacerts

RUN echo "vm.max_map_count=262144" >> /etc/sysctl.conf

Throws me the following error:

es01_1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
es01_1 | [2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
es01_1 | ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/es-docker-cluster.log

What else is missing?

After several hours of googling and debugging I eventually managed to turn off production mode by setting "discovery.type" to the value "single-node". I did it wiht OpenShift Web Console but it does not matter.

As far as I understand default mode for this setting has some other value so elasticsearch still performs bootstrap checks and fails. Probably the same effect would have been setting cluster.name variable to empty value but I did not try.

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