java - 更新DSpace Solr索引遇到此错误: SolrCore 'search' is not available due to init failure

标签 java solr dspace

当我运行以下命令来更新 Solr 索引时:

sh [dspace]/bin/dspace index-discovery

其中[dspace]是DSpace的安装目录,我收到以下错误:

Exception: Expected mime type application/octet-stream but got 

text/html. <!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> {msg=SolrCore &#39;search&#39; is not available due to init failure: Error opening new searcher,trace=org.apache.solr.common.SolrException: SolrCore &#39;search&#39; is not available due to init failure: Error opening new searcher
    at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:745)
    ...
    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.&lt;init&gt;(SolrCore.java:845)
    ... 8 more
.
.
.
Caused by: java.nio.file.AccessDeniedException: ....solr&#47;search&#47;data&#47;index&#47;segments_p
    at java.base&#47;sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)

最佳答案

将错误堆栈跟踪转换为 HTML 后,我发现文件 [dspace]/solr/search/data/index/segments_p 的权限阻止了进程访问它。该文件的所有者是 root 用户,我以非 root 用户身份使用 Eclipse 运行 Tomcat,因此我让自己成为该文件的所有者:

chown myself:myself [dspace]/solr/search/data/index/segments_p

然后重新启动 Tomcat,并重新运行命令:

sh [dspace]/bin/dspace index-discovery

做得很完美。

关于java - 更新DSpace Solr索引遇到此错误: SolrCore 'search' is not available due to init failure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57541514/

相关文章:

dspace - OAI-PHM。不更新记录

java - 需要有关 java 中 ExecutorService 的建议

java - 无法在 Eclipse for Java 的动态 Web 项目中加载属性文件

solr - 使用 SolrNet 从控制台应用程序查询 Solr?

solr - Solr 查询中的双引号

java - SolrLoggerUsageEventListener 发生错误,停止注册统计信息

java - GWT 中的 MVP 模式 : How to initialize Model/View and handle server requests in the Presenter?

java - 根据参数/用户选择更新 sqlite 表属性

r - Solr 索引中的聚类文档(具有自定义距离)

java - Solr 在 DSpace 安装中无法运行