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 ...

Get Solr Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.