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

相关文章

Java 中的 @SneakyThrows 注解使用方法(简化异常处理的利与弊)

《Java中的@SneakyThrows注解使用方法(简化异常处理的利与弊)》为了简化异常处理,Lombok提供了一个强大的注解@SneakyThrows,本文将详细介绍@SneakyThro... 目录1. @SneakyThrows 简介 1.1 什么是 Lombok?2. @SneakyThrows

SpringBoot3.4配置校验新特性的用法详解

《SpringBoot3.4配置校验新特性的用法详解》SpringBoot3.4对配置校验支持进行了全面升级,这篇文章为大家详细介绍了一下它们的具体使用,文中的示例代码讲解详细,感兴趣的小伙伴可以参考... 目录基本用法示例定义配置类配置 application.yml注入使用嵌套对象与集合元素深度校验开发

判断PyTorch是GPU版还是CPU版的方法小结

《判断PyTorch是GPU版还是CPU版的方法小结》PyTorch作为当前最流行的深度学习框架之一,支持在CPU和GPU(NVIDIACUDA)上运行,所以对于深度学习开发者来说,正确识别PyTor... 目录前言为什么需要区分GPU和CPU版本?性能差异硬件要求如何检查PyTorch版本?方法1:使用命

Qt实现网络数据解析的方法总结

《Qt实现网络数据解析的方法总结》在Qt中解析网络数据通常涉及接收原始字节流,并将其转换为有意义的应用层数据,这篇文章为大家介绍了详细步骤和示例,感兴趣的小伙伴可以了解下... 目录1. 网络数据接收2. 缓冲区管理(处理粘包/拆包)3. 常见数据格式解析3.1 jsON解析3.2 XML解析3.3 自定义

SpringMVC 通过ajax 前后端数据交互的实现方法

《SpringMVC通过ajax前后端数据交互的实现方法》:本文主要介绍SpringMVC通过ajax前后端数据交互的实现方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价... 在前端的开发过程中,经常在html页面通过AJAX进行前后端数据的交互,SpringMVC的controll

Java中的工具类命名方法

《Java中的工具类命名方法》:本文主要介绍Java中的工具类究竟如何命名,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录Java中的工具类究竟如何命名?先来几个例子几种命名方式的比较到底如何命名 ?总结Java中的工具类究竟如何命名?先来几个例子JD

Spring Security自定义身份认证的实现方法

《SpringSecurity自定义身份认证的实现方法》:本文主要介绍SpringSecurity自定义身份认证的实现方法,下面对SpringSecurity的这三种自定义身份认证进行详细讲解,... 目录1.内存身份认证(1)创建配置类(2)验证内存身份认证2.JDBC身份认证(1)数据准备 (2)配置依

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖

python获取网页表格的多种方法汇总

《python获取网页表格的多种方法汇总》我们在网页上看到很多的表格,如果要获取里面的数据或者转化成其他格式,就需要将表格获取下来并进行整理,在Python中,获取网页表格的方法有多种,下面就跟随小编... 目录1. 使用Pandas的read_html2. 使用BeautifulSoup和pandas3.

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊