skip to Main Content

I have the "vm.max_map_count [65530] is too low, increase to at least [262144]" error while elastic container starting on Docker 4.25, MacOS 14 and ARM core.

Here is my container props:

image: elasticsearch:8.9.0
container_name: elasticsearch
hostname: elastic
environment:
  - node.name=elasticsearch
  - cluster.name=es-docker-cluster
  - cluster.initial_master_nodes=elasticsearch
  - bootstrap.memory_lock=true
  - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
ulimits:
  memlock:
    soft: -1
    hard: -1
volumes:
  - es-data:/usr/share/elasticsearch/data
ports:
  - ${DC_ELASTIC_HOST_PORT}:${DC_ELASTIC_PORT}

I’ve tried the steps described here: Install Elasticsearch with Docker
But it does not helps.

command docker-machine ssh fails by Error: No machine name(s) specified and no "default" machine exists . Seems to vm machine must be created, but it requires VirtualBox that runs only on Intel core Macs.

command screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty fails due to path not found.

command sudo sysctl -w vm.max_map_count=262144 fails by sysctl: unknown oid 'vm.max_map_count'error too.

May be somebody knows any another solution ?

2

Answers


  1. Specifically, Elasticsearch requires the vm.max_map_count setting to be set to at least 262144. On macOS, Docker Desktop runs a virtualized Linux environment where the Elasticsearch container is actually running. Adjusting settings like vm.max_map_count within this environment can be challenging because it’s not as straightforward as on a native Linux host.

    • Before making this change, make sure Docker Desktop is not running.
    • You’ll need to edit the Docker Desktop configuration file directly. You can find this file at ~/Library/Group Containers/group.com.docker/settings.json. Open this file with a text editor.
    • In the settings.json file, look for the "linuxVmSettings" or similar section, and you may need to add or modify an entry for vm.max_map_count. If it’s not there, you can try to add something like this:
    "linuxVmSettings": {
      "vm.max_map_count": 262144
    }
    

    Save the changes to settings.json and start Docker Desktop again.

    Login or Signup to reply.
  2. Sadly, the only thing possible right now is to downgrade back to 2.24.2 (https://docs.docker.com/desktop/release-notes/#4242) for MacOS.

    I don’t know if it has something to do with the Rosetta implementation or not; try doing the software update for Rosetta (https://docs.docker.com/desktop/install/mac-install/#system-requirements) and see if that helps.

    This is not the answer right now, but it is a temporary work around.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search