土豆片开发日志-solr multicore

土豆片http://www.tudoupian.com)开发日志

 

土豆片开发配置solr的multicore,

在solr的安装包,example下有个multicore,把该文件下的所有文件,包括solr.xml,都拷贝到已经配置好的solr.home目录下。参考(原文地址:http://lianj-lee.javaeye.com/blog/425414):

1》找到solr下载包中的example文件夹,在它的下面有个multicore文件夹,将这个文件夹下面的所有东西copy到 c:/solr-tomcat/solr下面。
注意:有一个 solr.xml(这只是默认文件,当然也可以指定别的文件),如:

Xml代码 复制代码
  1. <?xml version="1.0" encoding="UTF-8" ?>     
  2.     <solr persistent="false">       
  3.       <cores adminPath="/admin/cores">     
  4.         <core name="core0" instanceDir="core0" />     
  5.         <core name="core1" instanceDir="core1" />     
  6.       </cores>     
  7.     </solr>    


这个文件是告诉solr应该加载哪些core,cores里有 core0,core1。core0(可以类比以前的solr.home)/conf目录下有schema.xml与solrconfig.xml,可以把实际应用的复制过来。现示例就用官方的了。

2》启动tomcat,访问应用,就可以看到有 Admin core0 和 Admin core1 http://localhost:8080/solr/

3》采用上面的默认solr.xml,索引文件将存放在同一个目录下面,在这里将存放在C:/solr-tomcat/solr/data,如果你想更改目录,或者两个应用存放在不同的目录,请参见下面的xml。

Xml代码 复制代码
  1. <core name="core0" instanceDir="core0">  
  2.     <property name="dataDir" value="/data/core0" />  
  3.  </core>  


给core添加子元素 property,property的两个属性就不说了,一看就能明白!
solr.core.name -- The core's name as defined in solr.xml
solr.core.instanceDir -- The core's instance directory (i.e. the directory under which that core's conf/ and data/ directory are located)
solr.core.dataDir -- The core's data directory (i.e. the directory under which that core's index directory are located)
solr.core.configName -- The name of the core's config file (solrconfig.xml by default)
solr.core.schemaName -- The name of the core's schema file (schema.xml by default)

4》solr.xml具体含义:
1)solr
The <solr> tag accepts two attributes:
persistent - By default, should runtime core manipulation be saved in solr.xml so that it is available after a restart.
sharedLib - Path to a directory containing .jar files that are added to the classpath of every core. The path is relative to solr.home (where solr.xml sits)
2)cores
The <cores> tag accepts two attribute:
adminPath - Relative path to access the CoreAdminHandler for dynamic core manipulation. For example, adminPath="/admin/cores" configures access via  http://localhost:8983/solr/admin/cores. If this attribute is not specified, dynamic manipulation is unavailable.
3)core
The <core> tag accepts two attributes:
name - The registered core name. This will be how the core is accessed.
instanceDir - The solr.home directory for a given core.
dataDir - The data directory for a given core. The default is <instanceDir>/data . It can take an absolute path or a relative path w.r.t instanceDir .  Solr1.4
4)property
The <property> tag accepts two attributes:
name - The name of the property
value - The value of the property
由于E文过于简单,所以就不翻译了!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值