下載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的路徑,根據(jù)自己需要更改配置。
這時(shí)候運(yùn)行tomcat會(huì)報(bào)錯(cuò) ? org.apache.catalina.core.StandardContext?startInternal?SEVERE: Error filterStart
org.apache.catalina.core.StandardContext?startInternal
?上網(wǎng)查了下原因,首先看這個(gè) http://wiki.apache.org/solr/SolrLogging ? ?,solr4.3的war包中不包含任何日志的jar包,你需要自己手動(dòng)添加。將solr目錄下example\lib\ext中的jar包c(diǎn)opy到tomcat的lib中。這時(shí)候雖然添加jar包,但是沒有對(duì)應(yīng)的日志配置,需要將example\resources中的log4j.properties也放到tomcat/lib中。當(dāng)然,你可以根據(jù)自己的需要更改配置。
?
啟動(dòng)tomcat,可以看到日志信息,確認(rèn)已經(jīng)成功啟動(dòng) ?打開?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.
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

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