jtreminio / dashtainer

MIT License
50 stars 3 forks source link

ElasticSearch memory locking failed #8

Closed simshaun closed 6 years ago

simshaun commented 6 years ago

Tried adding ElasticSearch and it errored out on start with:

Unable to lock JVM Memory: error=12, reason=Cannot allocate memory
..... lots of info lines
ERROR: [1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked

I had to add ulimits to the service config to get it running.

services:
   elasticsearch:
     image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3'
     environment:
       - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
     ulimits:
       memlock:
        soft: -1
        hard: -1

(if this even matters:) I'm running Docker from within WSL Ubuntu, but it's just using the Docker daemon exposed by the host (Windows 10 w/ Hyper-V)

jtreminio commented 6 years ago

ulimits should already be added to the docker-compose.yml file. If it's not then this is a bug!

simshaun commented 6 years ago

It doesn't look like it is. I just re-downloaded my project from dashtainer.com to check and it generates:

services:
  elasticsearch-6-2-3:
    image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3'
    environment:
      - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
    networks:
      - container-network
    restart: always
    volumes:
      - "$PWD/elasticsearch-6-2-3/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:delegated"
      - "elasticsearch-6-2-3-datastore:/usr/share/elasticsearch/data:delegated"