下載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.
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
