Java Solr 因在 org.apache.solr.core 上打开新搜索器时出错而停止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30747284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 10:06:51  来源:igfitidea点击:

Solr stopped with Error opening new searcher at org.apache.solr.core

javasolrlucene

提问by pavan kumar

Yesterday suddenly our solr server got stopped with following exception

昨天突然我们的 solr 服务器因以下异常而停止

org.apache.solr.common.SolrException: Error opening new searcher at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1438) at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1550) at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1319) at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:574) at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:95) at org.apache.solr.update.processor.UpdateRequestProcessor.processCommit(UpdateRequestProcessor.java:64) at org.apache.solr.update.processor.DistributedUpdateProcessor.processCommit(DistributedUpdateProcessor.java:1147) at org.apache.solr.update.processor.LogUpdateProcessor.processCommit(LogUpdateProcessorFactory.java:157) at org.apache.solr.handler.loader.XMLLoader.processUpdate(XMLLoader.java:266) at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:173) at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)

Caused by: java.io.IOException: Map failed at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:889) at org.apache.lucene.store.MMapDirectory.map(MMapDirectory.java:283) at org.apache.lucene.store.MMapDirectory$MMapIndexInput.

org.apache.solr.common.SolrException: 在 org.apache.solr.core.SolrCore.getSearcher(SolrCore.java: 1550) 在 org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1319) 在 org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:574) 在 org.apache.solr.update.processor .RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:95) 在 org.apache.solr.update.processor.UpdateRequestProcessor.processCommit(UpdateRequestProcessor.java:64) 在 org.apache.solr.update.processor.DistributedUpdateProcessor.processCommit(DistributedUpdateProcessor.java) :1147) 在 org.apache.solr.update.processor.LogUpdateProcessor.processCommit(LogUpdateProcessorFactory.java:157) 在 org.apache.solr.handler.loader.XMLLoader。processUpdate(XMLLoader.java:266) at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:173) at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)

引起:java.io.IOException: Map failed at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:889) at org.apache.lucene.store.MMapDirectory.map(MMapDirectory.java:283) at org. apache.lucene.store.MMapDirectory$MMapIndexInput。

But at that time we have lot of memory left in that server. Any guess?

但是当时我们在那个服务器上还剩下很多内存。有什么猜想吗?

回答by jay

Assuming its a linux system you can try ulimit -v unlimited

假设它是一个 linux 系统,您可以尝试 ulimit -v unlimited

Check the below links for more information.

查看以下链接以获取更多信息。

https://support.lucidworks.com/hc/en-us/articles/206127457-Caused-by-java-io-IOException-Map-failed

https://support.lucidworks.com/hc/en-us/articles/206127457-Caused-by-java-io-IOException-Map-failed

https://stackoverflow.com/a/8893684/689625

https://stackoverflow.com/a/8893684/689625

You will get answers much faster if you include more information, like the version of your software (in this case solr version), OS Name and version, Java version etc.

如果您包含更多信息,例如您的软件版本(在本例中为 solr 版本)、操作系统名称和版本、Java 版本等,您将更快地获得答案。

回答by Nifle

I got this error:

我收到此错误:

Error creating core [mm_shard1_replica1]: Error opening new searcher

and tried fiddling with ulimitand max_map_count

并尝试摆弄ulimitmax_map_count

In the end it turned out to be a bad error message because the problem turned out to be a corrupt index.

最终它变成了一个错误的错误信息,因为问题被证明是一个损坏的索引。

Fixed it by shutting down solr and doing this:

通过关闭 solr 并执行以下操作来修复它:

cd /var/lib/solr/example/solr-webapp/webapp/WEB-INF/lib
java -cp lucene-core-4.10.4.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex /path/to/index -fix

To just check wether the index is broken remove the -fixat the end of above command. After that I started up solr and it recreated its index from the rest of the solrcloud cluster.

要检查索引是否损坏,请删除-fix上述命令末尾的。之后,我启动了 solr,它从 solrcloud 集群的其余部分重新创建了它的索引。

回答by Hany Sakr

The flag -fix didn't work in my later version, instead I used exorcise

标志 -fix 在我以后的版本中不起作用,而是使用了驱魔

java -cp lucene-core-5.5.0.jar -ea:org.apache.lucene... org.apache.lucene.index.CheckIndex PATH_TO_INDEX -exorcise

I hope this could help.

我希望这会有所帮助。