现在的位置: 首页 > 综合 > 正文

solr多核配置

2017年05月25日 ⁄ 综合 ⁄ 共 1883字 ⁄ 字号 评论关闭

多核心的重点在于solr.xml配置,还有更新,查询时必须指定相应的核心名字:

如下配置2个核心,核心目录是solr.home/news,solr.home/apps

<cores adminPath="/admin/cores">   <core name="news" instanceDir="news" />   <core name="apps" instanceDir="apps" /> </cores>

配置文件和索引目录都在instanceDir下,我的solr家目录是/usr/local/solr/配置后 ,确保每个核心data目录tomcat有权限操作:

[root@localhost solr]# ls -lothr -rw-r--r-- 1 tomcat 7.3M Nov  7 15:34 solr.war drwxr-xr-x 4 tomcat 4.0K Dec  8 11:46 news drwxr-xr-x 4 tomcat 4.0K Dec  8 11:46 apps -rw-r--r-- 1 tomcat 1.3K Dec  8 11:55 solr.xml

[root@localhost solr]# ls -lothr news/ total 8.0K drwxr-xr-x 3 tomcat 4.0K Dec  8 11:46 data drwxr-xr-x 2 tomcat 4.0K Dec  8 13:41 conf

最近研究solr


solrconfig.xml配置:
<config>
  <luceneMatchVersion>LUCENE_x</luceneMatchVersion>
  <!--  The DirectoryFactory to use for indexes.
        solr.StandardDirectoryFactory, the default, is filesystem based.
        solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
  <lib dir="../../dist/" />
  <updateHandler class="solr.DirectUpdateHandler2" />

  <requestDispatcher handleSelect="true" >
    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
  </requestDispatcher>
  
  <requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
  <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
  <lst name="defaults">
     <str name="config">dataConfig.xml</str>
  </lst>
  </requestHandler>
      
  <!-- config for the admin interface --> 
  <admin>
    <defaultQuery>*:*</defaultQuery>
  </admin>

</config>

solr.xml配置:

<solr persistent="false">

  <!--
  adminPath: RequestHandler path to manage cores.  
    If 'null' (or absent), cores will not be manageable via request handler
  -->
  <cores adminPath="/admin/cores">
    <core name="" instanceDir="c0" />
    <core name="" instanceDir="c1" />
  </cores>
</solr>

抱歉!评论已关闭.