Skip navigation.

Jinglepot Collaboration

About Java and some other stuff..

Installing solr on Tomcat version 5.5 開源碼Java搜尋引擎 solr 跟 Tomcat 5.5 的安裝步驟

, , , ,

English:
These are some simple steps for installing solr on Tomcat 5.5 Please note the update date of this document, since solr and Tomcat's installation method can be changed in the future, this may not help you if you are referencing this long after I posted this blog entry.

Chinese:
Solr 跟 Lucene的中文資料不容易找,根據我自己經過多次嘗試後安裝成功的經驗在此先記錄下我自己的安裝方法,本來是以為Tomcat 5.5 跟 Tomcat 6.x 會一樣,結果發現有點小改變,但這裡因為我自己用的是Tomcat 5.5跟solr 1.2,所以暫時沒有關於Tomcat 6.x 跟 solr 1.2的詳細安裝方式,如果有人有Tomcat 6.x 跟 solr 1.2的安裝問題再發問吧.

Step 1.
Download a solr release from http://www.apache.org/dyn/closer.cgi/lucene/solr/, and extract it.

先下載 solr 壓縮檔並解壓縮到你的主機內.

Step 2.
Assuming that you extracted your solr to a folder named: apache-solr-1.2.0 (you can name it anyway and store it anywhere you want it.)

假設你的 solr 是解壓縮到 apache-solr-1.2.0 這個資料夾.

Step 3.
Stop Tomcat server.
Copy the apache-solr-1.2.0/dist/apache-solr-versionOfSolr.war to /usr/local/solr.war

(Do not put the solr.war in webapps directory)

停止 Tomcat, 先找這個資料途徑內的war檔: apache-solr-1.2.0/dist/apache-solr-xxx.war
複製這個war檔到/usr/local/ 並更名為 solr.war.


(solr.war 檔放哪都可以,就是不要放在webapps裡)

Copy the apache-solr-xxxx (or apache-solr-1.2.0 whatever the source folder is named)/example/solr directory to /usr/

複製 apache-solr-xxxx(下載後解壓縮的資料夾名稱,在此以apache-solr-xxx代表)/example/solr 這個資料夾到 /usr/

Step 4.
Creat a solr.xml under tomcat/conf/Cataline/localhost/ with the following content:

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

在 tomcat的 conf/Cataline/localhost/ 裡建立一個 solr.xml檔,並在內容寫上

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

docBase 要指定到你的solr.war的位置.
value 要指到你的 /solr/資料夾的位置.

Step 5.
Start Tomcat, and go to http://localhost(or tomcat IP)/solr/admin
If you get the solr admin page as shown on the solr wiki site, you have your solr installed and running.

啟動 Tomcat. 然後去tomcat的ip或 localhost下的 /solr/admin 頁面看看, 如果不是錯誤訊息頁面應該就安裝成功了.

Step 6.
Once you get your solr running, you can start configuring your solrconfig.xml and schema.xml of solr in solr/conf/ directory according to the guide on Solr wiki site. (Note: Don't forget to restart your tomcat after editing solrconfig.xml or schema.xml)

solr 會跑後當然就是要根據你的需要更改設定啦. 需要設定的檔有 solrconfig.xml 跟 schema.xml兩個檔.
你可以在 /usr/solr/conf 資料夾內找到這兩個檔. 設定方法可以參考 solr wiki的網站,這裡就暫時不討論.
最重要的是要記得每次跟改後要記得重新開啟 tomcat 這樣新的設定才會被套用.

That's it for today, I will try my best to keep this post up to date, and I will keep posting some related topics about solr.
For more detail about solr please refer to http://wiki.apache.org/solr/SolrTomcat

Something to start with.Solr 及 lucene 的 query 使用方法初級解說

Comments

hunterfish 9. January 2008, 03:20

妳好,打擾一下
我看到妳這篇文章
想和妳問一下妳可以使用update嘛?
我使用過後就沒辦法利用update新的資料進solr了

先謝謝您了

KT 13. February 2008, 06:56

update很正常. 你第一次加入資料就是使用update,應該不會有問題的,如果update有問題,你連第一次的資料都無法放入solr. 其實solr的更新,刪除都是使用update那一個程式.

檢查看看你的index是否被鎖住了.

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31