Problem
Got java.io.IOException: Too many open files
in solr indexing through jenkins.
Did some googling and found we have to set the ulimit for the box in where we are running the job.
So set the ulimit in a linux box with spec
Linux x86_64 GNU/Linux
in both of the following fashions
-
ulimit -n 1000000
-
/etc/security/limits.conf
userx soft nofile 1000000 userx hard nofile 1000000
Given
- userx is the user through which the jenkins job is being executed.
- when doing ssh to the box as userx manually through terminal and check
ulimit -n
am getting10000000
Question
But when executing the same ulimit -n through a jenkins job, only getting 1024 which is the default.
Any advice would be much helpful?
Best Answer
Make sure pam_limits.so is enabled for su if your jenkins startup script is using "su" for user switching.
For Ubuntu Server, uncomment "session required pam_limits.so" line in /etc/pam.d/su file