windows安装solr

来源:互联网 发布:telent 端口 编辑:程序博客网 时间:2024/06/05 20:54

一.工具版本

   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的搭建。


原创粉丝点击