solr4.8配置


最近时间在研究solr,关于配置,在网上搜的资料基本上都是过时的,不适用,无奈只能去wiki上找原文。长话短说,现将配置的过程贴出来分享下。

原文的出处是:http://wiki.apache.org/solr/SolrTomcat

根据原文,由于“Configure Tomcat to recognize the solr home directory you created, by adding the Java Options -Dsolr.solr.home=c:\web\solr and -Dsolr.velocity.enabled=false ”这句话不是很明白。所以根据“

* Note: For Tomcat 7 and Solr3.4(last version on 2011-09-23), the above option on setenv.bat may not work, so you could not use it and put this code fragment

  • on $CATALINA_HOME/conf/Catalina/localhost/solr.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <Context docBase="C:\apache-tomcat-7.0.21\webapps\solr.war" debug="0" crossContext="true" >
        <Environment name="solr/home" type="java.lang.String" value="C:\solr" override="true" />
    </Context>
”更换了tomcat的版本,最终的版本是:

solr的版本是4.8.1

中间件是Tomcat,版本是7.0.35

jdk版本需要是1.7


配置步骤:

1、下载solr、tomcat;

2、解压solr;

3、根据“

  • Make the "solr home" directory called, where you intend the application server to function, say c:\web\solr\ ”新建solr home

4、根据“

  • Copy the contents of the example\solr directory c:\temp\solrZip\example\solr\ to c:\web\solr\”把“解压路径\solr-4.8.1\example\solr”下的内容放置在solr home中

5、根据“

  • Copy the *solr*.war file from c:\temp\solrZip\dist\ to the Tomcat webapps directory c:\tomcat\webapps\
  • Rename the *solr*.war file solr.war ”把“解压路径\solr-4.8.1\dist”下的solr-4.8.1.war放置在tomcat安装路径下的webapps下,并重命名为solr.war

6、根据“

  • Note: For Tomcat 7 and Solr3.4(last version on 2011-09-23), the above option on setenv.bat may not work, so you could not use it and put this code fragment
    on $CATALINA_HOME/conf/Catalina/localhost/solr.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <Context docBase="C:\apache-tomcat-7.0.21\webapps\solr.war" debug="0" crossContext="true" >
        <Environment name="solr/home" type="java.lang.String" value="C:\solr" override="true" />
    </Context>
”在tomcat对应的路径新增solr.xml文件,并把xml文件的value修改为步骤3新建的solr home的路径

7、在生成的solr应用下需要新加入的包有:log4j-1.2.16.jar、slf4j-api-1.7.6.jar、slf4j-log4j12-1.7.6.jar、jcl-over-slf4j-1.7.6.jar、jul-to-slf4j-1.7.6.jar

8、至此配置就完成了

以上是配置的整个过程,最后访问solr的admin.html文件能够得到正确的结果。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值