solr学习第八课程----MultiCore的配置方法(第一集)

2023-11-29 04:38

本文主要是介绍solr学习第八课程----MultiCore的配置方法(第一集),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

solr学习第八课程分成两部分

1. solr学习第八课程----MultiCore的配置方法(第一集)

2. solr学习第八课程----MultiCore的配置方法(第二集)

 

 

solr学习第八课程----MultiCore的配置方法(第一集)目录
1. 备份单Core的solr环境
2. 搭建MutiCore的solr环境
3. 配置IKAnalyzer分词器
4. 多核心方式主从索引环境搭建
5. 验证多个core的情况

 

 


1. 备份单Core的solr环境
[root@demoserver solr]# ll
total 169632
drwxr-xr-x. 4 root root      4096 Jan 29 14:17 master
drwxr-xr-x. 4 root root      4096 Feb 16 15:08 slave
drwxr-xr-x. 4 root root      4096 Feb 16 16:18 slave_2
[root@demoserver solr]# tar -zcvf master_slave.tar.gz .


[root@demoserver solr]# ll
total 169632
drwxr-xr-x. 4 root root      4096 Jan 29 14:17 master
-rw-r--r--. 1 root root 173689613 Feb 16 17:11 master_slave.tar.gz
drwxr-xr-x. 4 root root      4096 Feb 16 15:08 slave
drwxr-xr-x. 4 root root      4096 Feb 16 16:18 slave_2
2. 搭建MutiCore的solr环境
第一步: Solr Multicore solr 1.3 的新特性
Solr Multicore 是 solr 1.3 的新特性。其目的一个solr实例,可以有多个搜索应用。

我们知道你既可以把不同类型的数据放到同一index中,也可以使用分开的多indexes。基于这一点,你只需知道如何使用多
indexes(实际上就是运行Solr的多实例)。尽管如此,为每一个类型添加一个完整的Solr实例会显得太臃肿庞大。

Solr1.3引入了Solr core的概念,该方案使用一个Solr实例管理多个indexes,这样就有热点core(hot core)的重读(reloading)
与交换(swap,通常是读index与写index交换),那么管理一个 core或index也容易些。每个Solr core由它自己的配置文件和索引数据组成。在多core执行搜索和索引几乎
和没有使用core一样。你只是添加core的名字为各自不同的URL。


单core情况下的如下搜索: 
http://localhost:8983/solr/select?q=dave%20matthews


在多core环境下,你可以通过如下方式访问一个名为mbartists的core:
http://localhost:8983/solr/core0/select?q=dave%20matthews

并非在URL中引入core name的参数名值对,而是用不同的context。这样就可以像在单core中执行你的管理任务,搜索,更新操作。

第二步:MultiCore的配置方法
1、找到solr下载包中的example文件夹,在它的下面有个multicore文件夹,将这个文件夹下面的core0、core1和solr.xml拷贝到 
/home/solr/master/solr4home下面,对应的centos的文件如下操作:
[root@demoserver solr4home]# ll
total 32
drwxr-xr-x. 2 root root 4096 Jan 29 14:07 bin
drwxr-xr-x. 4 root root 4096 Feb  1 01:30 collection1
drwxr-xr-x. 4 root root 4096 Feb 16 18:13 core0
drwxr-xr-x. 4 root root 4096 Feb 16 18:13 core1

-rw-r--r--. 1 root root 2473 Jan 29 14:07 README.txt
-rw-r--r--. 1 root root 1334 Feb 16 17:48 solr.xml
-rw-r--r--. 1 root root 1715 Feb 16 17:30 solr.xml.20140216
-rw-r--r--. 1 root root  501 Jan 29 14:07 zoo.cfg
注意:有一个 solr.xml(这只是默认文件,当然也可以指定别的文件),如:
<?xml version="1.0" encoding="UTF-8" ?>  
<solr persistent="false">    
 <cores adminPath="/admin/cores">  
<core name="core0" instanceDir="core0" />  
<core name="core1" instanceDir="core1" />  
 </cores>  
</solr>  
这个文件是告诉solr应该加载哪些core,<cores>……</cores>里有 core0、core1。core0(可以类比以前的solr.home)/conf目录下有
schema.xml与solrconfig.xml,可以把实际应用的/solr/conf/schema.xml复制过来(注意:solrconfig.xml不要复制)


2、启动tomcat,访问应用,就可以看到有 Admin core0 和 Admin core1 
http://192.168.17.128:9080/solr/#/
http://192.168.17.128:9080/solr/#/core1
http://192.168.17.128:9080/solr/core0/select?q=*%3A*&wt=json&indent=true

         
        
          
3、采用上面的默认solr.xml,索引文件将存放在同一个目录下面,在这里将存放在C:\solr-tomcat\solr\data,如果你想更改目录,或者两个应用存放在不同的目录,请参见下面的xml。
<core name="core0" instanceDir="core0">
<property name="dataDir" value="/opt/solr-tomcat/solr/data/core0" />
</core>
<core name="core1" instanceDir="core1">
<property name="dataDir" value="/opt/solr-tomcat/solr/data/core1" />
</core>

4、为何使用多core ?
Solr实例支持多core比启用多index要好(do more)。多core同时解决了在生产环境下的一些关键需求: 
1.重建索引 
2.测试配置变更 
3.合并索引 
4.运行时重命名core 
为何多core不是默认的?
多core是1.3版本中才加的,1.4后更成熟。我们强烈建议你使用多core,既是你现在的solr.xml只配置了一个core,虽然会比单个索引稍复杂,
但可以带来管理core上的好处。或许一天单个core可能最终RELOAD and STATUS命令,又或许单个core最终会被废禁。多个core会是Solr将来支持

大规模分布式索引的关键。因此,以后可以期待更多。

5. 配置IKAnalyzer分词器

<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<schema name="example core zero" version="1.1">
<types>
<fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 date   -->
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 IKAnalyzer   -->
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
</types>
<fields>   
<!-- general -->
<field name="id"        type="string"   indexed="true"  stored="true"  multiValued="false" required="true"/>
<field name="type"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="name"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="core0"     type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="_version_" type="long"     indexed="true"  stored="true"/>
<!-- added by at 2014/2/16 self define field at shenfl  -->
<field name="wareCode"       type="string" indexed="true" stored="true"/>
<field name="wareName"       type="text_ik" indexed="true" stored="true"/> 
<field name="wareStatus"     type="string" indexed="true" stored="true"/>
<field name="openDate"       type="date" indexed="true" stored="true"/>
<field name="shopPrice"      type="string" indexed="true" stored="true"/>
<field name="marketPrice"    type="string" indexed="true" stored="true"/>
<field name="deliverType"    type="string" indexed="true" stored="true"/>
<field name="wareIntegralValue" type="long" indexed="true" stored="true"/>
<field name="gCurValue"      type="long" indexed="true" stored="true"/>
<field name="mCurValue"      type="long" indexed="true" stored="true"/>
<field name="eCurValue"      type="long" indexed="true" stored="true"/>
<field name="isHtmlChannel"  type="string" indexed="true" stored="true"/>
<field name="isWapChannel"   type="string" indexed="true" stored="true"/>
<field name="isSearch"       type="string" indexed="true" stored="true"/>
<field name="sKind"          type="long" indexed="true" stored="true"/>
<field name="sName"          type="string" indexed="true" stored="true"/>
<field name="mKind"          type="long" indexed="true" stored="true"/>
<field name="mName"          type="string" indexed="true" stored="true"/>
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>name</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>
</schema>


4. 多核心方式主从索引环境搭建

  多核心主从索引的复制方式同单核心索引复制方式一致。
  slave中的core0、core1分别对应master中的core0、core1,具体配置步骤:

  Master服务器搭建

第一步:创建Master存放目录 

[solr@demoserver solr4home]$ ll
total 36
drwxr-xr-x. 2 solr solr 4096 Jan 29 14:07 bin
drwxr-xr-x. 4 solr solr 4096 Feb  1 01:30 collection1
drwxr-xr-x. 4 solr solr 4096 Feb 16 18:13 core0
drwxr-xr-x. 4 solr solr 4096 Feb 16 18:13 core1
drwxr-xr-x. 3 solr solr 4096 Feb 16 19:01 data
-rw-r--r--. 1 solr solr 2473 Jan 29 14:07 README.txt
-rw-r--r--. 1 solr solr 1334 Feb 21 13:35 solr.xml
-rw-r--r--. 1 solr solr 1715 Feb 16 17:30 solr.xml.20140216
-rw-r--r--. 1 solr solr  501 Jan 29 14:07 zoo.cfg

第二步:编辑solr.xml文件,添加多个core的配置

[solr@demoserver solr4home]$ cat solr.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
All (relative) paths are relative to the installation path
persistent: Save changes made via the API to this file
sharedLib: path to a lib directory that will be shared across all cores
-->
<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="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
</solr>


第三步:创建配置文件,也可以复制

[solr@demoserver conf]$ pwd
/home/solr/master/solr4home/core0/conf
[solr@demoserver conf]$ ll
total 12
-rw-r--r--. 1 solr solr 3646 Feb 25 14:10 schema.xml
-rw-r--r--. 1 solr solr 5116 Feb 25 14:00 solrconfig.xm


第四步: schema.xml配置文件

<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<schema name="example core zero" version="1.1">
<types>
<fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 date   -->
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 IKAnalyzer   -->
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
</types>
<fields>   
<!-- general -->
<field name="id"        type="string"   indexed="true"  stored="true"  multiValued="false" required="true"/>
<field name="type"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="name"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="core0"     type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="_version_" type="long"     indexed="true"  stored="true"/>
<!-- added by at 2014/2/16 self define field at shenfl  -->
<field name="wareCode"       type="string" indexed="true" stored="true"/>
<field name="wareName"       type="text_ik" indexed="true" stored="true"/> 
<field name="wareStatus"     type="string" indexed="true" stored="true"/>
<field name="openDate"       type="date" indexed="true" stored="true"/>
<field name="shopPrice"      type="string" indexed="true" stored="true"/>
<field name="marketPrice"    type="string" indexed="true" stored="true"/>
<field name="deliverType"    type="string" indexed="true" stored="true"/>
<field name="wareIntegralValue" type="long" indexed="true" stored="true"/>
<field name="gCurValue"      type="long" indexed="true" stored="true"/>
<field name="mCurValue"      type="long" indexed="true" stored="true"/>
<field name="eCurValue"      type="long" indexed="true" stored="true"/>
<field name="isHtmlChannel"  type="string" indexed="true" stored="true"/>
<field name="isWapChannel"   type="string" indexed="true" stored="true"/>
<field name="isSearch"       type="string" indexed="true" stored="true"/>
<field name="sKind"          type="long" indexed="true" stored="true"/>
<field name="sName"          type="string" indexed="true" stored="true"/>
<field name="mKind"          type="long" indexed="true" stored="true"/>
<field name="mName"          type="string" indexed="true" stored="true"/>
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>name</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>
</schema>


第五步: solrconfig.xml配置文件

[solr@demoserver conf]$ cat solrconfig.xml 
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
This is a stripped down config file used for a simple example...  
It is *not* a good example to work from. 
-->
<config>
<luceneMatchVersion>4.4</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<dataDir>${solr.core0.data.dir:}</dataDir>
<schemaFactory class="ClassicIndexSchemaFactory"/>
<updateHandler class="solr.DirectUpdateHandler2">
<updateLog>
<str name="dir">${solr.core0.data.dir:}</str>
</updateLog>
</updateHandler>
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
</lst>
</requestHandler>  
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" >
<lst name="master">
<!-- 当有新的索引被提交,标记新的索引和保存新索引的文件名 -->
<str name="replicateAfter">commit</str>
<!-- 当系统启动时,标记新的索引和保存新索引的文件名 -->
<str name="replicateAfter">startup</str>
<!-- 当索引优化时,标记新的索引和保存新索引的文件名,因为 commit,optimize 基本上是同时存在的,所以一般不用设置 optimize-->
<!-- <str name="replicateAfter">optimize</str>-->
<!-- 索引优化后创建一份备份索引,这个在复制过程中不需要设置 -->
<!--<str name="backupAfter">optimize</str>-->
<!-- 索引复制时,也同步从服务器的配置文件 solrconfig_slave.xml:solrconfig.xml 表示复制时,在slave端以solrconfig.xml进行保存,这样slave才能认识这个文件-->
<str name="confFiles">solrconfig_slave.xml:solrconfig.xml,schema.xml,stopwords.txt,elevate.xml</str>
<!-- 设置验证信息 -->
<str name="httpBasicAuthUser">admin</str>
<str name="httpBasicAuthPassword">123456</str>
</lst>
</requestHandler> 
<requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
</requestDispatcher>
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/update" class="solr.UpdateRequestHandler"  />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<!-- config for the admin interface --> 
<admin>
<defaultQuery>solr</defaultQuery>
</admin>
</config>


 

 

 

Slave服务器搭建

第一步:创建slave存放目录 

[solr@demoserver solr4home]$ pwd
/home/solr/slave/solr4home
[solr@demoserver solr4home]$ ll
total 36
drwxr-xr-x. 2 solr solr 4096 Feb 24 20:58 bin
drwxr-xr-x. 4 solr solr 4096 Feb 24 20:58 collection1
drwxr-xr-x. 4 solr solr 4096 Feb 24 20:58 core0
drwxr-xr-x. 4 solr solr 4096 Feb 24 20:58 core1
drwxr-xr-x. 3 solr solr 4096 Feb 24 20:58 data
-rw-r--r--. 1 solr solr 2473 Feb 24 20:58 README.txt
-rw-r--r--. 1 solr solr 1334 Feb 24 20:58 solr.xml
-rw-r--r--. 1 solr solr 1715 Feb 24 20:58 solr.xml.20140216
-rw-r--r--. 1 solr solr  501 Feb 24 20:58 zoo.cfg

第二步:编辑solr.xml文件,添加多个core的配置

[solr@demoserver solr4home]$ cat solr.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
All (relative) paths are relative to the installation path
persistent: Save changes made via the API to this file
sharedLib: path to a lib directory that will be shared across all cores
-->
<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="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
</solr>


第三步:创建配置文件,也可以复制

[solr@demoserver conf]$ pwd
/home/solr/slave/solr4home/core0/conf
[solr@demoserver conf]$ ll
total 12
-rw-r--r--. 1 solr solr 3646 Feb 25 14:10 schema.xml
-rw-r--r--. 1 solr solr 5116 Feb 25 14:00 solrconfig.xm


第四步: schema.xml配置文件

<?xml version="1.0" ?>
<schema name="example core zero" version="1.1">
<types>
<fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 date   -->
<fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
<!-- added by shenfl at 2014/2/16 IKAnalyzer   -->
<fieldType name="text_ik" class="solr.TextField">
<analyzer class="org.wltea.analyzer.lucene.IKAnalyzer"/>
</fieldType>
</types>
<fields>   
<!-- general -->
<field name="id"        type="string"   indexed="true"  stored="true"  multiValued="false" required="true"/>
<field name="type"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="name"      type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="core0"     type="string"   indexed="true"  stored="true"  multiValued="false" /> 
<field name="_version_" type="long"     indexed="true"  stored="true"/>
<!-- added by at 2014/2/16 self define field at shenfl  -->
<field name="wareCode"       type="string" indexed="true" stored="true"/>
<field name="wareName"       type="text_ik" indexed="true" stored="true"/> 
<field name="wareStatus"     type="string" indexed="true" stored="true"/>
<field name="openDate"       type="date" indexed="true" stored="true"/>
<field name="shopPrice"      type="string" indexed="true" stored="true"/>
<field name="marketPrice"    type="string" indexed="true" stored="true"/>
<field name="deliverType"    type="string" indexed="true" stored="true"/>
<field name="wareIntegralValue" type="long" indexed="true" stored="true"/>
<field name="gCurValue"      type="long" indexed="true" stored="true"/>
<field name="mCurValue"      type="long" indexed="true" stored="true"/>
<field name="eCurValue"      type="long" indexed="true" stored="true"/>
<field name="isHtmlChannel"  type="string" indexed="true" stored="true"/>
<field name="isWapChannel"   type="string" indexed="true" stored="true"/>
<field name="isSearch"       type="string" indexed="true" stored="true"/>
<field name="sKind"          type="long" indexed="true" stored="true"/>
<field name="sName"          type="string" indexed="true" stored="true"/>
<field name="mKind"          type="long" indexed="true" stored="true"/>
<field name="mName"          type="string" indexed="true" stored="true"/>
</fields>
<!-- field to use to determine and enforce document uniqueness. -->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>name</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="OR"/>
</schema>


第五步: solrconfig.xml配置文件

 
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" >
<lst name="slave">
<!-- 主服务器的URL,core_1是配置了多核,如果不是多核,连接应该是 http://www.abc.com/solr/replication -->
<!-- <str name="masterUrl">http://www.abc.com/solr/core_1/replication</str> -->
<str name="masterUrl">http://192.168.17.128:9080/solr/core0/replication</str>   
<!-- 1分钟同步一次 -->
<str name="pollInterval">00:00:60</str>
<!-- 压缩机制,来传输索引,可选 internal|external,internal表示内网,external表示外网 -->
<str name="compression">internal</str>
<!-- 设置超时时间  -->
<str name="httpConnTimeout">5000</str>
<str name="httpReadTimeout">10000</str>
<!-- 设置验证信息,要和master 服务器配置一样 -->
<str name="httpBasicAuthUser">admin</str>
<str name="httpBasicAuthPassword">123456</str>
</lst>
</requestHandler> 


以上重点介绍了Master、Slave架构中core0的配置操作步骤,其中Master、Slave架构中core1的配置和core0一样。

 后续请访问:

 solr学习第八课程分成两部分

1. solr学习第八课程----MultiCore的配置方法(第一集)

2. solr学习第八课程----MultiCore的配置方法(第二集)

 

这篇关于solr学习第八课程----MultiCore的配置方法(第一集)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/431476

相关文章

Python使用Pandas对比两列数据取最大值的五种方法

《Python使用Pandas对比两列数据取最大值的五种方法》本文主要介绍使用Pandas对比两列数据取最大值的五种方法,包括使用max方法、apply方法结合lambda函数、函数、clip方法、w... 目录引言一、使用max方法二、使用apply方法结合lambda函数三、使用np.maximum函数

Qt 中集成mqtt协议的使用方法

《Qt中集成mqtt协议的使用方法》文章介绍了如何在工程中引入qmqtt库,并通过声明一个单例类来暴露订阅到的主题数据,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一起看看吧... 目录一,引入qmqtt 库二,使用一,引入qmqtt 库我是将整个头文件/源文件都添加到了工程中进行编译,这样 跨平台

Nginx设置连接超时并进行测试的方法步骤

《Nginx设置连接超时并进行测试的方法步骤》在高并发场景下,如果客户端与服务器的连接长时间未响应,会占用大量的系统资源,影响其他正常请求的处理效率,为了解决这个问题,可以通过设置Nginx的连接... 目录设置连接超时目的操作步骤测试连接超时测试方法:总结:设置连接超时目的设置客户端与服务器之间的连接

Java判断多个时间段是否重合的方法小结

《Java判断多个时间段是否重合的方法小结》这篇文章主要为大家详细介绍了Java中判断多个时间段是否重合的方法,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录判断多个时间段是否有间隔判断时间段集合是否与某时间段重合判断多个时间段是否有间隔实体类内容public class D

Python使用国内镜像加速pip安装的方法讲解

《Python使用国内镜像加速pip安装的方法讲解》在Python开发中,pip是一个非常重要的工具,用于安装和管理Python的第三方库,然而,在国内使用pip安装依赖时,往往会因为网络问题而导致速... 目录一、pip 工具简介1. 什么是 pip?2. 什么是 -i 参数?二、国内镜像源的选择三、如何

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

Linux使用nload监控网络流量的方法

《Linux使用nload监控网络流量的方法》Linux中的nload命令是一个用于实时监控网络流量的工具,它提供了传入和传出流量的可视化表示,帮助用户一目了然地了解网络活动,本文给大家介绍了Linu... 目录简介安装示例用法基础用法指定网络接口限制显示特定流量类型指定刷新率设置流量速率的显示单位监控多个

Java覆盖第三方jar包中的某一个类的实现方法

《Java覆盖第三方jar包中的某一个类的实现方法》在我们日常的开发中,经常需要使用第三方的jar包,有时候我们会发现第三方的jar包中的某一个类有问题,或者我们需要定制化修改其中的逻辑,那么应该如何... 目录一、需求描述二、示例描述三、操作步骤四、验证结果五、实现原理一、需求描述需求描述如下:需要在

JavaScript中的reduce方法执行过程、使用场景及进阶用法

《JavaScript中的reduce方法执行过程、使用场景及进阶用法》:本文主要介绍JavaScript中的reduce方法执行过程、使用场景及进阶用法的相关资料,reduce是JavaScri... 目录1. 什么是reduce2. reduce语法2.1 语法2.2 参数说明3. reduce执行过程

C#中读取XML文件的四种常用方法

《C#中读取XML文件的四种常用方法》Xml是Internet环境中跨平台的,依赖于内容的技术,是当前处理结构化文档信息的有力工具,下面我们就来看看C#中读取XML文件的方法都有哪些吧... 目录XML简介格式C#读取XML文件方法使用XmlDocument使用XmlTextReader/XmlTextWr