将数据从Solr 1.4迁移到4.10到3.5索引问题

时间:2015-03-22 23:58:34

标签: tomcat solr solr4

我正在尝试使用Solr 3.5作为两个主要版本之间的中间状态从Solr 1.4升级到Solr 4.10。我认为,我迁移的数据集非常大,即数据文件夹大小超过13 GB。已成功从1.4迁移到3.5。我复制了集合的数据文件夹,并将conf文件夹从Solr 3.5复制到Solr 4.10。但是,我收到以下错误:

  

**错误CoreContainer创建核心错误[newsarchive]:打开新搜索者时出错**

详细的日志数据是:

org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:873)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:646)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:491)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1565)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1677)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:845)
    ... 8 more
Caused by: org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource: MMapIndexInput(path="C:\news\data\newsarchive\index\_4p.fdx")): 1 (needs to be between 2 and 3). This version of Lucene only supports indexes created with release 3.0 and later.
    at org.apache.lucene.codecs.lucene3x.Lucene3xStoredFieldsReader.checkCodeVersion(Lucene3xStoredFieldsReader.java:121)
    at org.apache.lucene.codecs.lucene3x.Lucene3xSegmentInfoReader.readLegacyInfos(Lucene3xSegmentInfoReader.java:75)
    at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:418)
    at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:458)
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:913)
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:759)
    at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:454)
    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:794)
    at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:77)
    at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:64)
    at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:279)
    at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:111)
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1528)
    ... 10 more

另外,我在日志中出现上述错误后在结尾处发现以下错误:

**

  

ERROR SolrIndexWriter SolrIndexWriter之前未关闭   finalize(),表示一个错误 - 可能的资源泄漏!!!

  

ERROR SolrIndexWriter关闭IndexWriter时出错

1 个答案:

答案 0 :(得分:1)

当Solr打开旧索引时,它尽可能少地更新它。通常,这意味着旧片段以新格式重写,直到它们合并为止。这样可以节省大量I / O,而且每次索引格式稍有变化时,拥有大型索引的人可能都不想重写整个索引。但是,这意味着您必须做一些额外的工作才能从Solr的旧版本(> 1主要版本)迁移索引。建议的过程是使用org.apache.lucene.index.IndexUpgrader升级索引而不合并。最简单的方法是抓住lucene-core 3.5 from Maven并运行java -cp lucene-core.jar org.apache.lucene.index.IndexUpgrader [-delete-prior-commits] [-verbose] indexDir,然后重复lucene-core 4.10