Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

Using Ubuntu 16.10 Docker 1.12.3 Docker Composer 1.8 Elastic latest tag of official elastic docker image

docker-compose.yml

version: '2'
services:
    elastic:
        image: elasticsearch
        environment:
            - ES_JAVA_OPTS=-Xmx2g -Xms2g

getting on logs

elastic_1 | ERROR: bootstrap checks failed elastic_1 | max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] elastic_1 | [2016-11-18T17:48:17,058][INFO ][o.e.n.Node ] [HK_OIan] stopping ...

Any idea, thanks

like image 399
bitgandtter Avatar asked Dec 06 '22 16:12

bitgandtter


2 Answers

After reading resources from elasticsearch official doc i manage to start the container updating my docker-compose.yml file by

version: '2'
services:
  elastic:
      image: elasticsearch
      environment:
          - ES_JAVA_OPTS=-Xmx2g -Xms2g
      ulimits:
          nofile:
              soft: 65536
              hard: 65536

adding the ulimit section

like image 111
bitgandtter Avatar answered May 15 '23 23:05

bitgandtter


Those who are using a direct docker run command instead of docker-compose can set ulimit like below.

docker run --ulimit nofile=65536:65536 -p 9200:9200 --name elastic-search docker.elastic.co/elasticsearch/elasticsearch:6.4.2
like image 28
arunjos007 Avatar answered May 16 '23 00:05

arunjos007