Issue
Getting java.io.IOException: Too many open files in Apache Solr.
Environment
Apache Solr (all versions, Linux-based systems)
Resolution
Steps
Increase the OS file descriptor limits and ensure they are applied to the Solr process. Perform the following steps to fix this issue:
Step 1. Step 1: Increase system-wide file descriptor limit
Edit /etc/sysctl.conf:
fs.file-max = 9999999 (to a high integer number if its set to low value)To update the value do sysctl -p to apply the changes and then sysctl -a | grep file-max to verify
Step 2. Increase per-user limits. To change the ulimit setting, edit the file /etc/security/limits.conf and set the hard and soft limits.
soft nofile 65535
hard nofile 65535
Step 3. Reboot
Verification
Run the following commands in terminal to verify values are changed accordingly:
#cat /proc/sys/fs/file-max
9999999
#sysctl -a | grep fs.file-max
fs.file-max = 9999999
#ulimit -n
65535