Dealing with the too many opened files exception
Sometimes, you might encounter a strange error—something that lays on the edge between Lucene and the operating system—the too many opened files exception. Such an error means that the user that Solr is running with is not allowed to use more file descriptors (http://en.wikipedia.org/wiki/File_descriptor). This results in Solr not being able to open new files, so indexing documents, merging segments, and many similar activities are not possible. Is there something we can do about it? Yes, we can, and this recipe will show you.
How to do it...
For the purpose of this recipe, let's assume that the header of the exception thrown by Solr looks as follows:
java.io.FileNotFoundException: /use/share/solr/data/index/_1.fdx (Too many open files)
What can you do instead of trying to pull your hair out of your head? First of all, this probably happened on a Unix/Linux-based operating system. So, let's start with setting the opened files limit higher. To...