我的Lucene索引已损坏。如果我运行“CheckIndex -fix”问题解决了,但是一旦我重新启动tomcat它就会再次损坏。
索引目录在运行Liferay-Tomcat的两个应用程序服务器之间共享。我正在修复1台服务器上的索引,并在另一台服务器正在运行时重新启动它。这是一个生产环境,所以我不能把它们都放下来。
有什么建议吗?
在修复之前,CheckIndex说:
Opening index @ /usr/local/tomcat/liferay/lucene/0
Segments file=segments_5yk numSegments=1 version=FORMAT_SINGLE_NORM_FILE [Lucene 2.2]
1 of 1: name=_2vg docCount=31
compound=false
hasProx=true
numFiles=8
size (MB)=0.016
no deletions
test: open reader.........FAILED
WARNING: fixIndex() would remove reference to this segment; full exception:
java.io.IOException: read past EOF
at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:151)
at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:38)
at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:78)
at org.apache.lucene.index.FieldInfos.read(FieldInfos.java:335)
at org.apache.lucene.index.FieldInfos.<init>(FieldInfos.java:71)
at org.apache.lucene.index.SegmentReader$CoreReaders.<init>(SegmentReader.java:119)
at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:652)
at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:605)
at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:491)
at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:903)
WARNING: 1 broken segments (containing 31 documents) detected
WARNING: would write new segments file, and 31 documents would be lost, if -fix were specified
答案 0 :(得分:0)
如果您使用多个应用程序服务器访问搜索索引,我建议您集成Solr服务器。所以你不会遇到2个app服务器试图在同一个文件上写的问题。您已经发现,这可能容易出错。 为了让Solr启动并运行,您必须遵循以下步骤:
以下是一些其他链接:
http://www.liferay.com/de/marketplace/-/mp/application/15193648
http://www.liferay.com/de/community/wiki/-/wiki/Main/Pluggable+Enterprise+Search+with+Solr