solr主从配置 自动实现索引同步

来源:互联网 发布:北京软件开发培训班 编辑:程序博客网 时间:2024/05/17 03:16

主solr配置,修改配置文件 SolrHome\core0\conf\solrconfig.xml

<requestHandler name="/replication" class="solr.ReplicationHandler" >
       <lst name="master">
         <str name="replicateAfter">commit</str>
         <str name="replicateAfter">startup</str>
         <str name="confFiles">schema.xml,stopwords.txt</str>
       </lst>
 </requestHandler>

 

 

从solr配置 ,修改配置文件 SolrHome\core1\conf\solrconfig.xml

 <requestHandler name="/replication" class="solr.ReplicationHandler" >
       <lst name="slave">
         <str name="masterUrl">http://127.0.0.1/core0/replication</str><!--主搜索引擎服务地址-->
         <str name="pollInterval">00:00:60</str><!--同步频率,1分钟一次-->
       </lst>
     </requestHandler>

 

masterUrl : 主服务器同步URL地址 
pollInterval:从服务器同步间隔,即每隔多长时间同步一次主服务器 
httpConnTimeout:设置连接超时(单位:毫秒) 
httpReadTimeout:如果设置同步索引文件过大,则应适当提高此值。(单位:毫秒) 
httpBasicAuthUser:验证用户名,需要和主服务器一致 
httpBasicAuthPassword:验证密码,需和主服务器一致 
compression:external or internal 使用SOLR自己的压缩算法或应用容器的

http://san-yun.iteye.com/blog/1498042

http://a280606790.iteye.com/blog/1415822

http://blog.sina.com.cn/s/blog_64d912e801017ncz.html

原创粉丝点击