【问题标题】:Migrating data from Solr 1.4 to 4.10 through 3.5 Index issue通过 3.5 索引问题将数据从 Solr 1.4 迁移到 4.10
【发布时间】:2015-03-22 23:58:33
【问题描述】:

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

** ERROR 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

另外,我在日志中发现上述错误之后的最后出现以下错误:

**

错误 SolrIndexWriter SolrIndexWriter 在之前没有关闭 finalize(),​ 表示一个错误——可能的资源泄漏!!!

ERROR SolrIndexWriter 关闭 IndexWriter 时出错

【问题讨论】:

    标签: tomcat solr solr4


    【解决方案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 重复。

    【讨论】:

    • 确实,我试过你从 CMD 看到的命令,我得到了这个错误:Error: Could not find or load main class org.apache.lucene.index.IndexUpgrader
    • 非常感谢,它是java -cp lucene-core.jar org.apache.lucene.index.IndexUpgrader [-delete-prior-commits] [-verbose] indexDir 但是,我只是在错误的地方使用它,即C:\ 但是,我应该在找到 lucene-core-3.5.0.jar 的地方使用它.一般应该在webapps\solr\WEB-INF\lib下的Tomcat目录下找到
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 2017-03-24
    • 2011-10-02
    • 2013-01-22
    • 2017-03-30
    • 2010-10-05
    • 1970-01-01
    相关资源
    最近更新 更多