【问题标题】:Solr Config Case Sensititivity- causing Solr to goes offline after restartSolr Config Case Sensititivity - 导致 Solr 在重启后下线
【发布时间】:2014-06-05 09:45:37
【问题描述】:

我正在使用 Solr 在 Windows 上进行多个大规模生产环境配置。最近我遇到了一个涉及 Solr 的非常奇怪的问题,在 Solr 中索引工作正常,但是当服务器或 Windows 服务器重新启动时,核心会脱机并且不再加载。

在花了很多时间并尝试了很多事情之后,我让它工作了,但想了解它为什么会这样..只有这个安装有这个问题..为什么其他 Solr 实例工作正常?

请注意,我的问题已通过下面描述的更改得到解决,但是我想了解问题的原因,因此需要对其行为的一些权威答案。

我在 Solrconfig.xml 中修改了一些东西,特别是我更改的请求处理程序之一,而文件中的所有其他元素完全相同。

旧的 solrconfig.xml 有以下内容

<requestHandler name="/select" class="solr.SearchHandler" >

     <lst name="defaults">
      <str name="echoParams">explicit</str>
      <int name="rows">2000</int>
      <str name="field">Name</str>
      <str name="spellcheck">on</str>     
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.dictionary">default</str>
      <str name="spellcheck.dictionary">wordbreak</str>
      <str name="spellcheck.maxCollations">5</str> 
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.alternativeTermCount">2</str>
      <str name="spellcheck.maxResultsForSuggest">5</str>
      <str name="spellcheck.maxCollationTries">5</str>
     </lst>

    <arr name="last-components">
      <str>spellcheck</str>
    </arr>


 </requestHandler>

新/更新的 solrconfig.xml 有以下内容

<requestHandler name="/select" class="solr.SearchHandler" >

     <lst name="defaults">
      <str name="echoParams">explicit</str>
      <int name="rows">2000</int>
      <str name="field">Name</str>
      <str name="spellcheck">on</str>     
      <str name="spellcheck.collate">true</str>
      <str name="spellcheck.dictionary">default</str>
      <str name="spellcheck.dictionary">wordbreak</str>
      <str name="spellcheck.maxcollations">5</str> 
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.alternativetermcount">2</str>
      <str name="spellcheck.maxresultsforsuggest">5</str>
      <str name="spellcheck.maxcollationtries">5</str>
     </lst>

    <arr name="last-components">
      <str>spellcheck</str>
    </arr>


 </requestHandler>

我在 Windows Server 2008 R2 上使用 Tomcat 7.0 和 Solr 4.7。

如果您仔细观察,唯一更改的行如下:

<str name="spellcheck.maxcollations">5</str> 
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.alternativetermcount">2</str>
      <str name="spellcheck.maxresultsforsuggest">5</str>
      <str name="spellcheck.maxcollationtries">5</str>
     </lst>

还有……骆驼大写的箱子变成了小号的。出人意料地改变它解决了这个问题!

我的问题是:

它对 Solr 的工作方式有什么影响吗? Solr 配置文件是否区分大小写?

如果是,那么为什么它可以与许多其他安装一起正常工作?为什么只有这种灌输有这个问题?

是否与 Solr / Tomcat 或操作系统版本有关?

2014 年 6 月 14 日更新

我们在重新启动时将以下错误记录到 catalina 日志文件中。我最初没有发布它,因为它对我们收到的问题似乎并不熟悉。但这可能会给你一些提示,所以在这里添加它:

严重:Web 应用程序 [/solr] 创建了一个 ThreadLocal,其键为 类型 [org.apache.solr.schema.DateField.ThreadLocalDateFormat] (值 [org.apache.solr.schema.DateField$ThreadLocalDateFormat@1362773])和 类型的值 [org.apache.solr.schema.DateField.ISO8601CanonicalDateFormat](值 [org.apache.solr.schema.DateField$ISO8601CanonicalDateFormat@6b2ed43a]) 但在 Web 应用程序停止时未能将其删除。线程 将随着时间的推移而更新,以尽量避免可能的记忆 泄漏。

【问题讨论】:

  • 您在启动时看到任何错误吗?
  • @sidgate 请检查我刚刚所做的更新..

标签: tomcat solr lucene solr4


【解决方案1】:

要回答第一个问题,solr 在它的 confix 和 schema xml 中确实是区分大小写的。这意味着以下参数将获得默认值:

spellcheck.maxcollations : 1
pellcheck.alternativetermcount : null
spellcheck.maxresultsforsuggest : null
spellcheck.maxcollationtries : 0

好的部分是有很多代码处理特殊情况,例如参数的空引用。不好的部分是我无法弄清楚在最后一个 solr 版本中这种行为是如何变化的,但它应该与操作系统无关。

此外,您发布的错误似乎是在应用程序关闭后引发的。您确定在此之前没有记录其他错误吗?

【讨论】:

  • 感谢您提供此信息...您能否指向已记录此信息的 solr wiki 页面?
  • 嗨,我正在等待您的回复...是的,我确定没有记录其他错误。我再次检查了它。
  • 嗨,虽然它没有回答我所有的问题,但你的回答解释了当大小写不匹配时,它采用默认值。更改为正确的大小写可以解决问题。谢谢你的回答。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-05-28
  • 2015-09-11
  • 1970-01-01
  • 1970-01-01
  • 2012-09-05
  • 2022-06-17
  • 2015-01-04
相关资源
最近更新 更多