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

相关文章

windos server2022的配置故障转移服务的图文教程

《windosserver2022的配置故障转移服务的图文教程》本文主要介绍了windosserver2022的配置故障转移服务的图文教程,以确保服务和应用程序的连续性和可用性,文中通过图文介绍的非... 目录准备环境:步骤故障转移群集是 Windows Server 2022 中提供的一种功能,用于在多个

Window Server2016加入AD域的方法步骤

《WindowServer2016加入AD域的方法步骤》:本文主要介绍WindowServer2016加入AD域的方法步骤,包括配置DNS、检测ping通、更改计算机域、输入账号密码、重启服务... 目录一、 准备条件二、配置ServerB加入ServerA的AD域(test.ly)三、查看加入AD域后的变

windos server2022里的DFS配置的实现

《windosserver2022里的DFS配置的实现》DFS是WindowsServer操作系统提供的一种功能,用于在多台服务器上集中管理共享文件夹和文件的分布式存储解决方案,本文就来介绍一下wi... 目录什么是DFS?优势:应用场景:DFS配置步骤什么是DFS?DFS指的是分布式文件系统(Distr

Window Server2016 AD域的创建的方法步骤

《WindowServer2016AD域的创建的方法步骤》本文主要介绍了WindowServer2016AD域的创建的方法步骤,文中通过图文介绍的非常详细,对大家的学习或者工作具有一定的参考学习价... 目录一、准备条件二、在ServerA服务器中常见AD域管理器:三、创建AD域,域地址为“test.ly”

NFS实现多服务器文件的共享的方法步骤

《NFS实现多服务器文件的共享的方法步骤》NFS允许网络中的计算机之间共享资源,客户端可以透明地读写远端NFS服务器上的文件,本文就来介绍一下NFS实现多服务器文件的共享的方法步骤,感兴趣的可以了解一... 目录一、简介二、部署1、准备1、服务端和客户端:安装nfs-utils2、服务端:创建共享目录3、服

Java 字符数组转字符串的常用方法

《Java字符数组转字符串的常用方法》文章总结了在Java中将字符数组转换为字符串的几种常用方法,包括使用String构造函数、String.valueOf()方法、StringBuilder以及A... 目录1. 使用String构造函数1.1 基本转换方法1.2 注意事项2. 使用String.valu

Python中使用defaultdict和Counter的方法

《Python中使用defaultdict和Counter的方法》本文深入探讨了Python中的两个强大工具——defaultdict和Counter,并详细介绍了它们的工作原理、应用场景以及在实际编... 目录引言defaultdict的深入应用什么是defaultdictdefaultdict的工作原理

关于Maven中pom.xml文件配置详解

《关于Maven中pom.xml文件配置详解》pom.xml是Maven项目的核心配置文件,它描述了项目的结构、依赖关系、构建配置等信息,通过合理配置pom.xml,可以提高项目的可维护性和构建效率... 目录1. POM文件的基本结构1.1 项目基本信息2. 项目属性2.1 引用属性3. 项目依赖4. 构

使用Python进行文件读写操作的基本方法

《使用Python进行文件读写操作的基本方法》今天的内容来介绍Python中进行文件读写操作的方法,这在学习Python时是必不可少的技术点,希望可以帮助到正在学习python的小伙伴,以下是Pyth... 目录一、文件读取:二、文件写入:三、文件追加:四、文件读写的二进制模式:五、使用 json 模块读写

Oracle数据库使用 listagg去重删除重复数据的方法汇总

《Oracle数据库使用listagg去重删除重复数据的方法汇总》文章介绍了在Oracle数据库中使用LISTAGG和XMLAGG函数进行字符串聚合并去重的方法,包括去重聚合、使用XML解析和CLO... 目录案例表第一种:使用wm_concat() + distinct去重聚合第二种:使用listagg,