2

我最近从 Solr 3.6 更新到 Solr4 Beta 版本。我在尝试一次又一次地更新和提交相同的记录时遇到以下异常。有人可以帮忙解决这个问题吗???

SEVERE: org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1267)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1379)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1157)
    at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:560)
    at org.apache.solr.update.processor.RunUpdateProcessor.processCommit(RunUpdateProcessorFactory.java:87)
    at org.apache.solr.update.processor.UpdateRequestProcessor.processCommit(UpdateRequestProcessor.java:64)
    at org.apache.solr.update.processor.DistributedUpdateProcessor.processCommit(DistributedUpdateProcessor.java:959)
    at org.apache.solr.update.processor.LogUpdateProcessor.processCommit(LogUpdateProcessorFactory.java:157)
    at org.apache.solr.handler.RequestHandlerUtils.handleCommit(RequestHandlerUtils.java:69)
    at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:68)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1656)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:454)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:275)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:219)
    at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:333)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1812)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed
    at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:553)
    at org.apache.lucene.index.IndexWriter.ensureOpen(IndexWriter.java:558)
    at org.apache.lucene.index.IndexWriter.nrtIsCurrent(IndexWriter.java:4061)
    at org.apache.lucene.index.StandardDirectoryReader.doOpenFromWriter(StandardDirectoryReader.java:261)
    at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:240)
    at org.apache.lucene.index.StandardDirectoryReader.doOpenIfChanged(StandardDirectoryReader.java:230)
    at org.apache.lucene.index.DirectoryReader.openIfChanged(DirectoryReader.java:166)
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1213)
    ... 30 more
4

1 回答 1

2

在 SolrConfig.xml 的查询部分中,增加 MaxWarmingsearches 的数量并将 useColdSearcher 设置为 true。您可以在这里找到更多信息。 http://wiki.apache.org/solr/FAQ#What_does_.22exceeded_limit_of_maxWarmingSearchers.3DX.22_mean.3F

<query>
 <useColdSearcher>true</useColdSearcher>
 <maxWarmingSearchers>6</maxWarmingSearchers>
</query>

参加 SolrCloud 训练营并听取 Solr 团队的意见后进行更新。

  • 如果增加Warming Searchers 的数量,将有助于减少上述异常,但对Searching 没有帮助。
  • 分面、分组、函数查询等搜索使用 Max Warming Searchers,因此如果您看到上述异常,他们建议减少提交次数。增加 maxWarmingSearchers,对您没有任何帮助。

  • 他们建议每秒提交一次。如果您计划每秒执行 100 次提交并希望查看实时更新,您可以通过关闭 maxWarmingSearchers 来实现。但是,如果您将其关闭,则分面和分组等查询将花费更多时间。

于 2012-11-27T16:47:03.720 回答