Solr over NFS problems



Our application uses embedded Solr instance for search. The data directory is located on NFS and I cannot change that. The usage of Solr is very simple, there’s a single thread that periodically updates index and there are several reader threads – these all are inside one java process. No other Solr interaction takes place.

With default “solrconfig.xml” I sometimes run into “java.nio.channels.OverlappingFileLockException”. As far as I understand the reason is actually “SimpleFSLockFactory” not working correctly with NFS.


  1. Given the application scenario described above (no concurrent index modifications), shouldn’t NoLockFactory be enough? Are there any drawbacks in using NoLockFactory? If I setup NoLockFactory I get a number of entries in error log saying that “CONFIGURATION WARNING: locks are disabled”. Why does that message go into error log? Is that really considered an error case and why?

  2. Maybe there’s a better solution than using “NoLockFactory”?

  3. Not sure this is related to NFS, but sometimes (quiet rare) my index gets corrupted and I get lots of “ _i.fdx” while trying to update an index. There’s no way out of this other than manually delete the whole index directory and start from scratch. Why can this happen and is there any graceful way to automatically detect broken index and recover?





Storing your indexes over NFS is prone to problems, but if it had to be run over NFS, I predict that this problem arises possibly from not using NFSv4, or not using it correctly. NFSv4 is the first version to support locking byte-ranges, NFSv2 & v3 (poorly) support entire files, and without running portmap, rpc.lockd and rpc.statd – the locks are probably only advisory (as opposed to mandatory), but definitely not going to be covered for byte-range locking.

java.nio.channels.OverlappingFileLockException says

Unchecked exception thrown when an attempt is made to acquire a lock on a region of a file 
that overlaps a region already locked by the same Java virtual machine, or when another 
thread is already waiting to lock an overlapping region of the same file.

A cursory search of the Lucene mailing list returns many results that seem to indicate that using Lucene (and, by extension, Solr) over NFS is a bad idea.

Locking issues aside, the performance will probably be pretty bad as well.

I know this isn’t the answer you were hoping for, but it’s the answer you need.


[], [], []

Facebook Comments

Post a comment