2

I have installed elasticsearch @ debian6 by this tutorial. I have set up my system max open files directives so i have these values:

# su
# cat /proc/sys/fs/file-max
70000

# ulimit -Hn
64000

# ulimit -Sn
32000

When i check elasticsearch max_file_descriptors by:

curl -XGET 'http://localhost:9200/_nodes?process=true&pretty=true'

i'll get 1024.

When i restart it by root user, it has "max_file_descriptors" : 64000 now.

Whats wrong with that init.d autostart? When i check htop, elastic autostarted by init.d with that 1024 descriptors is runnig under root user too.

I have set max files open by 2 confs:

cat /etc/sysctl.conf
...
fs.file-max = 70000

cat /etc/security/limits.conf
...
*   soft    nofile  32000
*   hard    nofile  64000

root    soft    nofile  32000
root    hard    nofile  64000
2
  • How did you increase the open file limit?
    – mgorven
    Nov 2, 2012 at 0:03
  • I updated my question by these informations
    – palmic
    Nov 2, 2012 at 8:00

1 Answer 1

6

The settings in /etc/security/limits.conf usually get applied by the pam_limits PAM module. Services started by init don't run under a PAM session however, and so these settings are not applied. The only reliable way I've found to set this is to run ulimit from the initscript itself. Edit the ElasticSearch initscript and add something like this near the top:

ulimit -n 64000

I'm not sure that you want to set sys.file-max BTW; on my system it defaults to 779149, and so you may be decreasing it by an order of magnitude.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .