關於 Apache Solr 無法啟動的問題

Arthur1977 发布于 2014/12/01 22:22
阅读 3K+
收藏 0
你好,我的作業環境是  Windows Server 2008 R2 ,
                      Apache Tomcat/8.0.15 ,  

                      Solr 的版本是 4.10.2

我安裝 Solr 的方式如下:

-------------------------------------------------------------------------------------------------------------------------------------------
將solr-4.7.1.zip 裡面的\example\webapps\solr.war copy 到 tomcat的 webapps目錄下 ( 例: D:\apache-tomcat-7.0.53\webapps\solr.war )

新增一個空白目錄來放 solr 將來產生出來的索引, ( 例: D:\Folder_Index\ )

將solr-4.7.1.zip 裡面的\example\solr\ 下的檔案(含子目錄) 一併拷貝到剛才新開的索引目錄 ( 例: D:\Folder_Index\ )

修改 tomcat 的啟動變數: 編輯 D:\apache-tomcat-7.0.53\bin\catalina.bat , 在最上面加上這一行 set JAVA_OPTS=-Dsolr.solr.home=d:\Folder_Index ,

再啟動一次 Tomcat: 執行 D:\apache-tomcat-7.0.53\bin\startup.bat , 此時 solr.war 安裝包將會被安裝. Tomcat啟動完畢後把tomcat關閉.

tomcat 確認關閉後 , 檢視 tomcat 的目錄 D:\apache-tomcat-7.0.53\webapps\ ,確認有一個 solr 的目錄之後 .把 solr.war 安裝包刪除.

最後 copy 下列 lib 檔案
將solr-4.7.1.zip 裡面的 \example\lib\ext*.* copy 到 D:\apache-tomcat-7.0.53\webapps\solr\WEB-INF\lib\
將solr-4.7.1.zip 裡面的 \example\resources\log4j.properties copy 到 D:\apache-tomcat-7.0.53\lib\
------------------------------------------------------------------------------------------------------------------------------------------
但是在瀏覽 solr 的頁面的時候卻會出現以下錯誤訊息:

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/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/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:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2407) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2396) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.solr.common.SolrException: Could not load conf for core collection1: Error loading solr config from solr/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(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ... 1 more Caused by: org.apache.solr.common.SolrException: Error loading solr config from solr/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 'C:\Program Files\Apache Software Foundation\Tomcat 8.0\solr\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}

------------------------------------------------------------------------------------------------------------------

有人知道該如何解決嗎?

感謝幫忙。

加载中
0
抢小孩糖吃
抢小孩糖吃
僵尸项目之前重新配置,solr3.6 ,我没有对tomcat做修改,放入war包之后直接吧web-
抢小孩糖吃
抢小孩糖吃
inf里面的配置文件做修改指向solr的数据,之后复制example的两个依赖包文件到solr 数据文件夹
返回顶部
顶部