4

I have a fresh installation of Ubuntu 16.04 and I installed elasticsearch 5 on it. Now when I try to start elasticsearch using

/etc/init.d/elasticsearch start

After a few seconds in the log file I read:

[2016-11-19T08:47:31,442][ERROR][o.e.b.Bootstrap          ] [shooter-1] node validation exception
bootstrap checks failed
max number of threads [1891] for user [elasticsearch] likely too low, increase to at least [2048]

After some googling, I came to the conclusion that I had to add the following line to /etc/security/limits.conf:

elasticsearch    -       nproc           2048

However, even after this change, I still get the same error.

I found a suggestion to uncomment the line

session    required   pam_limits.so

in /etc/pam.d/su, but that line was already uncommented.

What am I missing?

Bart van den Burg
  • 403
  • 1
  • 5
  • 8

3 Answers3

2

Ok, I finally found it. The key was in this blogpost: https://fredrikaverpil.github.io/2016/04/27/systemd-and-resource-limits/

The solution was to edit the file /usr/lib/systemd/system/elasticsearch.service and add the line

LimitNPROC=2048
Bart van den Burg
  • 403
  • 1
  • 5
  • 8
1

We ran into this issue also and it turned out to be a systemd service override file that we likely created when originally setting up elasticsearch.

The override file is referenced here in the docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html#systemd

Check /etc/systemd/system/elasticsearch.service.d/ for any conf files and either remove them or update them with the correct LimitNPROC= for your elasticsearch version.

Greg H
  • 11
  • 2
0
  1. When I was checking elasticsearch service on ES nodes it was throwing below error

    [root@h ~]# /etc/init.d/elasticsearch status
    

    elasticsearch dead but subsys locked

  2. Further checked the logs and found below errors [2020-03-26T07:41:03,281][ERROR][o.e.b.Bootstrap ] [h2-es-data-0] node validation exception [1] bootstrap checks failed [1]: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048] [2020-03-26T07:41:03,284][INFO ][o.e.n.Node ] [h2-es-data-0] stopping ... [2020-03-26T07:41:03,322][INFO ][o.e.n.Node ] [h2-es-data-0] stopped

  3. I have added below lines in /etc/security/limits.conf to increase threadpool on all 6 es nodes

    elasticsearch - nproc 2048

  4. Restarted services on all ES nodes

    /etc/init.d/elasticsearch restart