linux下配置solr后启动tomcat报错无法解决,求大佬

发布于 2022-09-06 12:28:49 字数 7412 浏览 18 评论 0

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:745) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:307) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) 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:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:489) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249) at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more Caused by: org.apache.solr.common.SolrException: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:154) at org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:80) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:61) ... 7 more Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/solr/solrhome/collection1/conf' at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:362) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:308) at org.apache.solr.core.Config.<init>(Config.java:117) at org.apache.solr.core.Config.<init>(Config.java:87) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:167) at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:145) ... 9 more ,code=500}
type Status report

message {msg=SolrCore 'collection1' is not available due to init failure: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml,trace=org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:745) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:307) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207) 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:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 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: Could not load conf for core collection1: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:66) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:489) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:255) at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249) at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more Caused by: org.apache.solr.common.SolrException: Error loading solr config from /solr/solrhome/collection1/conf/solrconfig.xml at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:154) at org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:80) at org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:61) ... 7 more Caused by: java.io.IOException: Can't find resource 'solrconfig.xml' in classpath or '/solr/solrhome/collection1/conf' at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:362) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:308) at org.apache.solr.core.Config.<init>(Config.java:117) at org.apache.solr.core.Config.<init>(Config.java:87) at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:167) at org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:145) ... 9 more ,code=500}

description The server encountered an internal error that prevented it from fulfilling this request.

Apache Tomcat/7.0.47

以下几种方式都试过了没有用:

1.释放tomcat下的/webapps/solr/WEB-INF/web.xml中的<env-entry>标签,并修改标签下的<env-entry-value>标签内容为solrhome的路径.我可以确保修改的路径没有问题,但是不管用.而且这个是我一开始就配置了的,.没启动tomcat之前
2.修改solrhome下/collection1/conf/solrconfig.xml,释放标签:<unlockOnStartup>   并将值false改为true.不管用
3.solrhome目录建立文件solr.xml,内容:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <solr> 
    </solr>
  还是不管用...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水波映月 2022-09-13 12:28:49

1:安装 Tomcat,解压缩即可
2:解压 solr。
3:把 solr 下的dist目录solr-4.10.3.war部署到 Tomcatwebapps下(去掉版本号)。
4:启动 Tomcat解压缩 war 包
5:把solr下example/lib/ext 目录下的所有的 jar 包,添加到 solr 的工程中(WEB-INFlib目录下)。
6:创建一个 solrhome 。solr 下的/example/solr 目录就是一个 solrhome。复制此目录到D盘改名为solrhome
7:关联 solr 及 solrhome。需要修改 solr 工程的 web.xml 文件。
<env-entry>

   <env-entry-name>solr/home</env-entry-name>
   <env-entry-value>d:\solrhome</env-entry-value>
   <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

8:启动 Tomcat
http://IP:8080/solr/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文