Fixing Elasticsearch in Docker: Raising vm.max_map_count and Connection Errors

Running Elasticsearch in Docker Compose can fail with exit code 78 when the host's vm.max_map_count is below the required threshold, as bootstrap checks enforce the limit when the node binds to a non-loopback address. Elastic's current documentation recommends setting this value to 1048576 on the Docker host rather than inside the container, and persisting it via /etc/sysctl.d/ so it survives reboots. Connection problems can also arise when an app container targets localhost instead of the Compose service name, and with security enabled by default in recent versions, the ELASTIC_PASSWORD must be set and Basic authentication used. The guide's failures were reproduced in a lab using Elasticsearch 9.1.5 and a curl client on the same Compose network.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in