java - Apache Solr 核心架构从 4.x 升级到 5.x(或更高版本)

标签 java solr solrj

我正在将 solr 4.x 迁移到 5.x。我在 solr 5.x 上创建了相同的核心,并将旧的 [corename]/data/index 目录复制到 [corename]/data/index。但出现以下异常。

java.util.concurrent.ExecutionException: org.apache.solr.common.SolrException: Unable to create core
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.apache.solr.core.CoreContainer$2.run(CoreContainer.java:476)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Unable to create core []
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:741)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:447)
at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:438)
... 5 more
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:820)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:659)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:727)
... 7 more
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1662)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1773)
at org.apache.solr.core.SolrCore.initSearcher(SolrCore.java:916)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:793)
... 9 more
Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in LockValidatingDirectoryWrapper(NRTCachingDirectory(MMapDirectory@ lockFactory=org.apache.lucene.store.NativeFSLockFactory@6d76b8fa; maxCacheMB=48.0 maxMergeSizeMB=4.0)): files: [_fca_Lucene41_0.tip, _fc1_Lucene41_0.tim, _fcb_2.del, _fc1_Lucene41_0.tip, _fcb_Lucene41_0.pos, _fca_Lucene41_0.tim, _fca.si, _fc7.si, _fca_2.del, _fc2.nvm, _fcc.nvd, _fcb.si, _fc2.nvd, _fcc.nvm, _fc8.si, _fce.si, _fcc.fnm, _fcd.si, _fc1_Lucene41_0.doc, _fcd.fnm, _fc1.si, _fc1.nvd, _fc7.fdx, _fcd_Lucene41_0.pos, _fc7.fdt, _fc1.nvm, _fc2.fnm, _fca.fdx, _f56.si, _fc8_Lucene41_0.doc, _f56_Lucene41_0.doc, _fcc_Lucene41_0.doc, _fc9.fnm, _fcb_Lucene41_0.doc, _fcc_Lucene41_0.tim, _fcc_Lucene41_0.tip, _fc7_Lucene41_0.pos, _fc1.fdt, _fca.fdt, _fcd_1.del, _fcd_Lucene41_0.tip, _fcb.nvm, _fce_Lucene41_0.tim, _fcd_Lucene41_0.tim, _fc1.fdx, _fce_Lucene41_0.tip, _fcb.nvd, _fcc.fdt, _fcc.fdx, _fc8.fnm, _fca.fnm, _fcd.fdx, _fcd.fdt, _fcb.fdx, _fc7.nvm, _fc8.nvm, _fc9.nvd, segments.gen, _fc8_Lucene41_0.tim, nohup.out, _fcc_2.del, _fcc.si, _fc9.si, _fc7_Lucene41_0.tim, _f56.nvm, _fcd.nvm, _fc1.fnm, _fc9.nvm, _fc7.nvd, _fc8.nvd, _f56.nvd, _fcb.fdt, _fcd.nvd, _fca_Lucene41_0.pos, _fc9.fdt, _fce.fdx, _fce_Lucene41_0.doc, _fce.fdt, _fc8.fdx, _fc7_Lucene41_0.doc, _fca.nvm, _fc8.fdt, _fca.nvd, _fc9.fdx, _fc9_Lucene41_0.pos, _fce.nvm, _fc8_Lucene41_0.tip, _fc9_Lucene41_0.doc, _fc9_Lucene41_0.tim, _fc9_Lucene41_0.tip, _fc8_Lucene41_0.pos, _fcb.fnm, _fc2_8.del, _fce_Lucene41_0.pos, _fcb_Lucene41_0.tip, _fce.nvd, write.lock, _fcb_Lucene41_0.tim, _fc2_Lucene41_0.tip, _fc1_Lucene41_0.pos, _fc2.fdx, _fc2_Lucene41_0.tim, _fcd_Lucene41_0.doc, _fcc_Lucene41_0.pos, _f56_Lucene41_0.pos, _fc2_Lucene41_0.doc, _f56.fnm, _fce.fnm, _fc7_Lucene41_0.tip, _f56_Lucene41_0.tim, _fc2.fdt, _fca_Lucene41_0.doc, _f56_Lucene41_0.tip, _fc7.fnm, _fc2_Lucene41_0.pos, _fc2.si, _f56.fdt, _f56.fdx]

谁能帮我解决这个问题吗?

谢谢。

最佳答案

如果删除数据目录(首先制作了副本),Solr 会在启动时重新创建一个空目录吗?

如果没有,请检查 solrconfig.xml 以查看数据目录所在的位置

https://cwiki.apache.org/confluence/display/solr/DataDir+and+DirectoryFactory+in+SolrConfig

如果是,则可能是文件丢失或存在某些索引不兼容。如果您将其复制回来,您的索引是否仍然适用于 4.0?

您始终可以尝试在 4.0 索引上运行 IndexUpgrader 将其升级到 5.0,但如果您的索引是使用 Solr 4.0 创建的,则不需要这样做

关于java - Apache Solr 核心架构从 4.x 升级到 5.x(或更高版本),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37852603/

相关文章:

jquery - 错误: cannot call methods on autocomplete prior to initialization; attempted to call method 'destroy'

java - 使用 solrj 和 schema.xml 将实体添加到 solr

java - 聊天应用程序的 "Send"按钮不起作用

java - 尝试在 android 中通过 JSONarray 验证密码

java - 将 String 转换为 application/octet-stream Java

java - 如何使用Java创建网络图片

solr - solr中如何避免重复文档?

SolrJ - 启用身份验证插件时无法提交更新

java - 有没有办法在solrj中动态更新数据索引而不需要重新启动EmbeddedSolrServer?

java - SOLR 匹配短语(SHINGLE FILTER)