windows安裝solr

一.工具版本

   1.jdk1.6.0_33  

http://www.oracle.com/technetwork/java/javase/downloads/index.html

   2.apache-tomcat-7.0.78 

http://tomcat.apache.org/index.html

   3.solr-4.7.2

       http://archive.apache.org/dist/lucene/solr/4.7.2/

二.配置

     1.先安裝JDK,配置環境變量、解壓tomcat、解壓solr做好準備工作。

     2.將solr-4.7.2\example\webapps下的solr.war拷貝至apache-tomcat-7.0.78\webapps下

     3.將solr-4.7.2\example\lib\ext下的所有jar包拷貝至apache-tomcat-7.0.78\lib下

     4.將solr-4.7.2\example\solr包拷貝至apache-tomcat-7.0.78下(該路徑無特定要求,可根據個人喜好拷貝至對應目錄。)

     5.新建solr.xml,配置內容如下

        其中value爲第4點的solr包路徑。

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="webapps/solr.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="E:\gzrj\apache-tomcat-7.0.78\solr" override="true"/>
</Context>
      6. 先運行一次tomcat的startup.bat,將會在conf中生成apache-tomcat-7.0.78\conf\Catalina\localhost路徑

      7.將solr.xml拷貝至第6點的路徑下,即完成配置,再次啓動startup效果如下:


       8.在apache-tomcat-7.0.78\solr下新增core0,將apache-tomcat-7.0.78\solr\collection1下的conf包複製到core0中

       9.在控制檯中點擊core admin→add core,在name與instanceDir中輸入core0,點擊保存如果沒有提示錯誤則完成solr的搭建。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章