title: docker-compose ERROR: bootstrap checks failed | max > virtual memory areas vm.max_map_count [65530] is too low, increase to > at least [262144]
body: <p>I am getting this error:</p>
  
  <blockquote>
    <p>es01      | {"type": "server", "timestamp":
    "2019-09-18T17:31:42,267+0000", "level": "INFO", "component":
    "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", 
    "message": "starting ..."  } es01      | {"type": "server",
    "timestamp": "2019-09-18T17:31:42,709+0000", "level": "INFO",
    "component": "o.e.t.TransportService", "cluster.name":
    "docker-cluster", "node.name": "es01",  "message": "publish_address
    {172.21.0.3:9300}, bound_addresses {0.0.0.0:9300}"  } es01      |
    {"type": "server", "timestamp": "2019-09-18T17:31:42,760+0000",
    "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name":
    "docker-cluster", "node.name": "es01",  "message": "bound or
    publishing to a non-loopback address, enforcing bootstrap checks"  }</p>
  </blockquote>
  
  <p>the error that matters:</p>
  
  <blockquote>
    <p>ERROR: [1] bootstrap checks failed es01      | [1]: <em>max
    virtual memory areas vm.max_map_count [65530] is too low, increase to
    at least [262144]</em> </p>
  </blockquote>
  
  <p>and then the node stops because of the above error:</p>
  
  <blockquote>
    <p>es01      | {"type": "server", "timestamp":
    "2019-09-18T17:31:42,810+0000", "level": "INFO", "component":
    "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "es01", 
    "message": "stopping ..."  } es01      | {"type": "server",
    "timestamp": "2019-09-18T17:31:42,904+0000", "level": "INFO",
    "component": "o.e.n.Node", "cluster.name": "docker-cluster",
    "node.name": "es01",  "message": "stopped"  } es01      | {"type":
    "server", "timestamp": "2019-09-18T17:31:42,905+0000", "level":
    "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster",
    "node.name": "es01",  "message": "closing ..."  } es01      | {"type":
    "server", "timestamp": "2019-09-18T17:31:42,967+0000", "level":
    "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster",
    "node.name": "es01",  "message": "closed"  } es01      | {"type":
    "server", "timestamp": "2019-09-18T17:31:42,976+0000", "level":
    "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name":
    "docker-cluster", "node.name": "es01",  "message": "Native controller
    process has stopped - no new native processes can be started"  }</p>
  </blockquote>
  
  <p>my docker-compose.yml file is as follows:</p>
  
  <pre><code>version: '2.2'
  services:
    kibana:
      depends_on:
        - es01
        - es02
      image: docker.elastic.co/kibana/kibana:7.3.1
      container_name: kibana
      ports:
        - 5601:5601
      environment:
        ELASTICSEARCH_HOSTS: http://es01:9200
        ELASTICSEARCH_URL: http://es01:9200
    es01:
      image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
      container_name: es01
      environment:
        - node.name=es01
        - discovery.seed_hosts=es02
        - cluster.initial_master_nodes=es01,es02
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      ulimits:
        memlock:
          soft: -1
          hard: -1
      volumes:
        - esdata01:/usr/share/elasticsearch/data
      ports:
        - 9200:9200
        - 9300:9300
    es02:
      image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
      container_name: es02
      environment:
        - node.name=es02
        - discovery.seed_hosts=es01
        - cluster.initial_master_nodes=es01,es02
        - cluster.name=docker-cluster
        - bootstrap.memory_lock=true
        - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      ulimits:
        memlock:
          soft: -1
          hard: -1
      volumes:
        - esdata02:/usr/share/elasticsearch/data
  
  volumes:
    esdata01:
      driver: local
    esdata02:
      driver: local
  </code></pre>
  
  <p>does anyone know how I can increase the memory of the cluster and fix the error?</p>