solr4.7.2环境搭建

系统环境

win7 64位

jdk 7

solr 4.7.2

apache-tomcat-7.0.69

下载地址

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

下载解压

D:\Soft\solr-4.7.2

目录说明

contrib:solr功能模块需要的库,根据需要引用
dist:发布目录
docs:Solr 文档及教程目录 
example:官方提供的Solr使用例子
                  D:\Soft\solr-4.7.2\example\webapps\solr.war  (solr admin web application)
                  D:\Soft\solr-4.7.2\example\multicore ( solr core 例子)
solr_core:自己新建的目录,存储solrcore用的

环境搭建

1) tomcat配置 server.xml 

新增URIEncoding="UTF-8" 配置防止中文乱码

<Connector port="8899" protocol="HTTP/1.1"  
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8" />

2)  将D:\Soft\solr-4.7.2\example\webapps\solr.war放到tomcat\webapps目录中,解压出来

3)  配置索引库路径

修改apache-tomcat-7.0.69\webapps\solr\WEB-INF\web.xml 文件

tomcat 和 sorl 都在D盘,使用绝对路径

<!-- 配置solr core 的路径 -->
    <env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>/Soft/solr-4.7.2/solr_core/solr</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>

4) 增加依赖jar包

D:\Soft\solr-4.7.2\example\lib\ext中的jar拷贝到apache-tomcat-7.0.69\webapps\solr\WEB-INF\lib目录中

5) 新增日志配置文件

D:\Soft\solr-4.7.2\example\resources\log4j.properties拷贝到apache-tomcat-7.0.69\webapps\solr\WEB-INF\classes目录中,修改配置文件改成绝对路径,会在D:\solrlogs生成日志文件

solr.log=/solrlogs

6)  拷贝core文件

D:\Soft\solr-4.7.2\example\solr拷贝到D:\Soft\solr-4.7.2\solr_core\solr目录中

D:\Soft\solr-4.7.2\solr_core\solr 在上面第3步配置的

这样启动tomcat后将会看到默认的collection1

7)启动tomcat

http://127.0.0.1:8899/solr

7) 默认core

能看到默认collection1说明core目录配置正确

8) 创建core

D:\Soft\solr-4.7.2\example\multicore目录中的core0整个目录拷贝到D:\Soft\solr-4.7.2\solr_core\solr目录中

什么都不改,然后add core将能看到core0

 

重新拷贝core0,将core0文件夹改成testcore,同时修改testcore\conf\solrconfig.xml

将 ${solr.core0.data.dir:} 改成 ${solr.testcore.data.dir:} 

然后add core,将能看到testcore

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值