在tomcat中運行solr-4.3.0


下載solr 4.3,tomcat,解壓等操作不必多說.  

將解壓后的solr下的dist目錄中的solr-4.3.0.war ,copy到tomcat的webapps目錄中,並改名為solr.war

 

Solr uses UTF-8 file encoding. That means that we need to ensure
that Apache Tomcat will be informed that all requests and responses made should use that
encoding. To do that, we modified the server.xml file in the way shown in the following code:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />

 

The third step is to create a proper context file. To do that, create a solr.xml file
in the $TOMCAT_HOME/conf/Catalina/localhost directory. The contents of
the file should look like the following code:

<Context path="/solr" docBase="/usr/share/tomcat/webapps/solr.war"
debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/
usr/share/solr/" override="true"/>
</Context>

以上配置中,docBase為tomcat/webapps/solr.war的路徑,下面的路徑為下載solr目錄中example/solr的路徑,根據自己需要更改配置。

這時候運行tomcat會報錯     org.apache.catalina.core.StandardContext startInternal SEVERE: Error filterStart

              org.apache.catalina.core.StandardContext startInternal

 上網查了下原因,首先看這個http://wiki.apache.org/solr/SolrLogging   ,solr4.3的war包中不包含任何日志的jar包,你需要自己手動添加。將solr目錄下example\lib\ext中的jar包copy到tomcat的lib中。這時候雖然添加jar包,但是沒有對應的日志配置,需要將example\resources中的log4j.properties也放到tomcat/lib中。當然,你可以根據自己的需要更改配置。

 

啟動tomcat,可以看到日志信息,確認已經成功啟動  打開 http://localhost:8080/solr/ 

If you see the page with links to administration pages of each of the cores defined, that
means that your Solr is up and running.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM