クラスター化された Websphere 環境で Lucene 4.3.1 を使用しています。両側で、共有 NFS ボリュームにあるインデックスを共有する必要があります。
次のスタック トレースを取得し続けます。
Lock obtain timed out: NativeFSLock@/<pathToIndex>/write.lock
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/<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 );
そして、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();
}
そのようなシナリオで使用する正しい方法は何ですか?