我在集群Websphere环境中使用Lucene 4.3.1。双方应共享位于共享NFS卷上的索引。在具有共享NFS的群集环境中使用Lucene
我不断收到以下堆栈跟踪:
Lock obtain timed out: [email protected]/<pathToIndex>/write.lock
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/<pathToIndex>/write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:84)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:667)
我用下面的代码来获取目录:
directory = FSDirectory.open(indexPath);
,我打开和关闭的作家(在clustermembers)在ejb的方法:
public void removeWikiDocument(long oid) {
IndexWriter writer = new IndexWriter(directory, config);
Term t = new Term(OID, Long.toString(oid));
writer.deleteDocuments(t);
writer.commit();
writer.close();
}
有人知道我在做什么错吗分别是什么我在这种情况下使用正确的方法。