2

I am trying to update nexus from 3.2.0 to nexus 3.7.1 ,getting a max file descriptors error message

using docker container sonatype/nexus3:3.7.1

i tried to increase the descriptors to 65536 but it is not reflecting when i try with ulimit

I did: cat /etc/security/limits.conf

nexus hard nofile 65536 nexus soft nofile 65536

restarted my docker container

values: ulimit -n 1024 ulimit -Hn 4096 ulimit -Sn 1024

enter image description here

Swat
  • 445
  • 5
  • 7

1 Answers1

3

Looks to be explained in the Nexus docs here https://help.sonatype.com/repomanager3/system-requirements#SystemRequirements-AdequateFileHandleLimits


On most Linux systems, persistent limits can be set for a particular user by editing the /etc/security/limits.conf file. To set the maximum number of open files for both soft and hard limits for the nexus user to 65536, add the following line to the /etc/security/limits.conf file, where "nexus" should be replaced with the user ID that is being used to run the repository manager:

nexus - nofile 65536

This change will only take effect the next time the nexus process user opens a new session. Which essentially means that you will need to restart NXRM.

On Ubuntu systems there is a caveat: Ubuntu ignores the /etc/security/limits.conf file for processes started by init.d.

So if NXRM is started using init.d there, edit /etc/pam.d/common-session and uncomment the following line ( remove the hash # and space at the beginning of the line):

# session    required   pam_limits.so

For more information refer to your specific operating system documentation.

If you're using systemd to launch the server the above won't work. Instead, modify the configuration file to add a LimitNOFILE line:

[Unit] 
Description=nexus service 
After=network.target

[Service] 
Type=forking  
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start 
ExecStop=/opt/nexus/bin/nexus stop 
User=nexus 
Restart=on-abort

[Install] 
WantedBy=multi-user.target
  • Although I added both the limits.conf and the systemd level settings mentioned in that link and it did not change on restart of the Nexus server. – Daniel Holmes Apr 17 '18 at 20:31
  • OK, this does work with the systemd method. Problem I was having was forgetting to "systemctl daemon-reload" after editing the service file before restarting the Nexus daemon. – Daniel Holmes Apr 18 '18 at 14:15