2012-08-17 171 views
0

我們的應用程序每2小時左右崩潰一次,而且我們正在看到數據庫連接出現峯值。還沒有孤立這個問題。爲什麼會發生這種異常? Lucene異常

有人可以迴應以下例外的真正意義,它可以激增數據庫連接問題。

謝謝。

org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 
org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 
org.compass.core.engine.SearchEngineException: Failed to open writer for sub index [premiumobjectmessage]; nested exception is org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/opt/compass/index/premiumobjectmessage/lucene-9af515d29c67db8ae587aab2becbc6f3-write.lock 

回答

1

這源於想要打開相同FSDirectory多個線程/進程。也許每個有自己數據庫連接的線程也會自己創建IndexReader,這將是一個錯誤的方法。 IndexReader s/IndexSearcher必須像DB連接本身一樣彙集,最好使用NRTManager

+0

謝謝Marko。將盡量按照您的指示。 – Jason 2012-08-17 16:52:04

相關問題