skip to Main Content

When I am installing ElasticSearch using docker-compose(CentOS 7.6MAC OS),runing command ‘docker-compose up‘ ,it throw this error ‘efk_elasticsearch_1 exited with code 78‘,this is my docker-compose.yml:

version: '2'
services:

  elasticsearch:
    image: elasticsearch:7.2.0
    expose:
      - 9200
    ports:
      - "9200:9200"

3

Answers


  1. you need to run this in your HOST terminal not the container:

    sudo sysctl -w vm.max_map_count=262144
    

    if you check the container logs you will see something like this:

    max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    

    please note also the above command will be reseted after rebooting your machine, you need to set the value in /etc/sysctl.conf to make it permenant.

    see this

    Login or Signup to reply.
  2. Using the Docker images in production or local

    The following requirements and recommendations apply when running Elasticsearch in Docker in production.

    Set vm.max_map_count to at least 262144
    The vm.max_map_count kernel setting must be set to at least 262144 for production use.

    How you set vm.max_map_count depends on your platform.

    Linux

    To view the current value for the vm.max_map_count setting, run:

    grep vm.max_map_count /etc/sysctl.conf
    vm.max_map_count=262144
    

    To apply the setting on a live system, run:

    sysctl -w vm.max_map_count=262144
    

    To permanently change the value for the vm.max_map_count setting, update the value in /etc/sysctl.conf.

    macOS with Docker for Mac

    The vm.max_map_count setting must be set within the xhyve virtual machine:

    From the command line, run:

    screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
    Press enter and use sysctl to configure vm.max_map_count:

    sysctl -w vm.max_map_count=262144
    

    To exit the screen session, type Ctrl a d.

    Windows and macOS with Docker

    The vm.max_map_count setting must be set via docker-machine:

    docker-machine ssh
    sudo sysctl -w vm.max_map_count=262144
    

    **Windows with Docker Desktop WSL 2 **

    The vm.max_map_count setting must be set in the docker-desktop container:

    wsl -d docker-desktop
    sysctl -w vm.max_map_count=262144
    
    Login or Signup to reply.
  3. This made it for me:

    wsl -d docker-desktop
    sysctl -w vm.max_map_count=262144
    

    On powershell & WSL 1

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