# Elastic Search, Docker and max virtual memory areas error

**URL:** <https://discuss.elastic.co/t/elastic-search-docker-and-max-virtual-memory-areas-error/357907>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 22, 2024, 11:46am UTC](https://discuss.elastic.co/t/elastic-search-docker-and-max-virtual-memory-areas-error/357907 "2024-04-22T11:46:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hack3rcon](https://discuss.elastic.co/u/hack3rcon)\
**Post date:** [April 22, 2024, 11:46am UTC](https://discuss.elastic.co/t/elastic-search-docker-and-max-virtual-memory-areas-error/357907/1 "2024-04-22T11:46:06Z")

</div>

Hello,  
My YAML file is as follows:

```auto
services:
  es01:
    image: elasticsearch:8.13.0
    container_name: Elasticsearch01
    environment:
      - node.name=es01
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:
        resources:
            limits:
                cpus: "2"
                memory: 4G
            reservations:
                memory: 2G
    logging:
      options:
        max-size: "5m"
# volumes:

    ports:
      - 127.0.0.1:9200:9200
      - 127.0.0.1:9300:9300

  es02:
    image: elasticsearch:8.13.0
    container_name: Elasticsearch02
    environment:
      - node.name=es02
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:
        resources:
            limits:
                cpus: "2"
                memory: 4G
            reservations:
                memory: 2G
    logging:
      options:
          max-size: "5m"
# volumes:

  es03:
    image: elasticsearch:8.13.0
    container_name: Elasticsearch03
    environment:
      - node.name=es03
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es01,es02
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    deploy:
        resources:
            limits:
                cpus: "2"
                memory: 4G
            reservations:
                memory: 2G
    logging:
    options:
        max-size: "5m"
# volumes:

```

I got the following error:

```auto
Elasticsearch01 | {"@timestamp":"2024-04-22T10:58:06.681Z", "log.level":"ERROR", "message":"node validation exception\n[2] bootstrap checks failed. You must address the points described in the following [2] lines before starting Elasticsearch. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.13/bootstrap-checks.html]\nbootstrap check failure [1] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.13/_maximum_map_count_check.html]\nbootstrap check failure [2] of [2]: Transport SSL must be enabled if security is enabled. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.13/bootstrap-checks-xpack.html#bootstrap-checks-tls]", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.bootstrap.Elasticsearch","elasticsearch.node.name":"es01","elasticsearch.cluster.name":"es-docker-cluster"}
Elasticsearch01 | ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/es-docker-cluster.log
Elasticsearch01 | ERROR: Elasticsearch died while starting up, with exit code 78
Elasticsearch01 | {"@timestamp":"2024-04-22T11:11:01.623Z", "log.level":"ERROR", "message":"node validation exception\n[1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. For more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.13/bootstrap-checks.html]\nbootstrap check failure [1] of [1]: Transport SSL must be enabled if security is enabled. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]; for more information see [https://www.elastic.co/guide/en/elasticsearch/reference/8.13/bootstrap-checks-xpack.html#bootstrap-checks-tls]", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.bootstrap.Elasticsearch","elasticsearch.node.name":"es01","elasticsearch.cluster.name":"es-docker-cluster"}
Elasticsearch01 | ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/es-docker-cluster.log
Elasticsearch01 | ERROR: Elasticsearch died while starting up, with exit code 78

```

I ran the command ` sysctl -w vm.max_map_count=262144`, but problem exist.

Any idea?

Thank you.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 22, 2024, 1:36pm UTC](https://discuss.elastic.co/t/elastic-search-docker-and-max-virtual-memory-areas-error/357907/2 "2024-04-22T13:36:25Z")

</div>

@hack3rcon exactly which OS?  
Did you stop and start the docker process?

Not to mention that compose will not work because of the incorrect security settings

Also please use 8.13.2 ...

Perhaps you should use the recommended compose [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-compose-file)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 20, 2024, 1:37pm UTC](https://discuss.elastic.co/t/elastic-search-docker-and-max-virtual-memory-areas-error/357907/3 "2024-05-20T13:37:19Z")

</div>

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