您的位置:首页 > 运维架构 > Tomcat

在window+tomcat7+jdk7下配置solr4.5

2013-12-04 18:27 232 查看
背景:想在自己的本地xp系统上配置solr服务,在solr交流群187670960里找到篇文章
3. 安装solr

下载:http://www.apache.org/dyn/closer.cgi/lucene/solr/4.4.0
http://mirror.esocc.com/apache/lucene/solr/4.5.0/solr-4.5.0.zip

下载完成后直接解压至F:\solr

4. slor安装至tomcat

a. 将f:\solr\examples下的slor文件夹复制到f:\tomcat 下面,作为solr的home目录

b. 将f:\solr\examples\webapps下的solr.war复制到tomcat的webapps目录下,war包在tomcat启动后会自动解压出来

c. 配置solr的data目录,打开f:/tomcat/solr/collection1/conf/solrconfig.xml,修改datadir:

<!-- Data Directory

Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.  If
replication is in use, this should match the replication
configuration.
-->
<dataDir>${solr.data.dir:F:\tomcat\solr\data}</dataDir>

d. 将solr.war注册给tomcat,在f:/tomcat/conf/Catalina/localhost/下创建solr.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="f:/tomcat/webapps/solr" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String" value="f:/tomcat/solr"
override="true" />
</Context>

e. 防止乱码的在tomcat/conf/server.xml中加入;
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8"/>

f. 将F:\solr\example\lib\ext下的5个jar包和F:\solr\example\resources下的log4j放入tomcat的lib目录下

g. 重新启动tomcat,浏览器中输入:http://localhost:8080/solr:
最后的时候会报一个错误Error loading class 'solr.clustering.ClusteringComponent
网上查找后从文章/article/1408266.html中找到解决方法
将tomcat/solr/collection1/conf/solrconfig.xml中的solr.clustering.enabled:true改为false再重启tomcat后访问一切正常
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: