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

相关文章

SpringBoot中使用Flux实现流式返回的方法小结

《SpringBoot中使用Flux实现流式返回的方法小结》文章介绍流式返回(StreamingResponse)在SpringBoot中通过Flux实现,优势包括提升用户体验、降低内存消耗、支持长连... 目录背景流式返回的核心概念与优势1. 提升用户体验2. 降低内存消耗3. 支持长连接与实时通信在Sp

Conda虚拟环境的复制和迁移的四种方法实现

《Conda虚拟环境的复制和迁移的四种方法实现》本文主要介绍了Conda虚拟环境的复制和迁移的四种方法实现,包括requirements.txt,environment.yml,conda-pack,... 目录在本机复制Conda虚拟环境相同操作系统之间复制环境方法一:requirements.txt方法

Nginx 重写与重定向配置方法

《Nginx重写与重定向配置方法》Nginx重写与重定向区别:重写修改路径(客户端无感知),重定向跳转新URL(客户端感知),try_files检查文件/目录存在性,return301直接返回永久重... 目录一.try_files指令二.return指令三.rewrite指令区分重写与重定向重写: 请求

MySQL 打开binlog日志的方法及注意事项

《MySQL打开binlog日志的方法及注意事项》本文给大家介绍MySQL打开binlog日志的方法及注意事项,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要... 目录一、默认状态二、如何检查 binlog 状态三、如何开启 binlog3.1 临时开启(重启后失效)

Nginx 配置跨域的实现及常见问题解决

《Nginx配置跨域的实现及常见问题解决》本文主要介绍了Nginx配置跨域的实现及常见问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来... 目录1. 跨域1.1 同源策略1.2 跨域资源共享(CORS)2. Nginx 配置跨域的场景2.1

Python中提取文件名扩展名的多种方法实现

《Python中提取文件名扩展名的多种方法实现》在Python编程中,经常会遇到需要从文件名中提取扩展名的场景,Python提供了多种方法来实现这一功能,不同方法适用于不同的场景和需求,包括os.pa... 目录技术背景实现步骤方法一:使用os.path.splitext方法二:使用pathlib模块方法三

Python打印对象所有属性和值的方法小结

《Python打印对象所有属性和值的方法小结》在Python开发过程中,调试代码时经常需要查看对象的当前状态,也就是对象的所有属性和对应的值,然而,Python并没有像PHP的print_r那样直接提... 目录python中打印对象所有属性和值的方法实现步骤1. 使用vars()和pprint()2. 使

CSS实现元素撑满剩余空间的五种方法

《CSS实现元素撑满剩余空间的五种方法》在日常开发中,我们经常需要让某个元素占据容器的剩余空间,本文将介绍5种不同的方法来实现这个需求,并分析各种方法的优缺点,感兴趣的朋友一起看看吧... css实现元素撑满剩余空间的5种方法 在日常开发中,我们经常需要让某个元素占据容器的剩余空间。这是一个常见的布局需求

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指