1.主机SolrConfig.xml

<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<!--Replicate on 'startup' and 'commit'. 'optimize' is also a valid value for replicateAfter. -->
<str name="replicateAfter">startup</str>
<str name="replicateAfter">commit</str> <!--Create a backup after 'optimize'. Other values can be 'commit', 'startup'. It is possible to have multiple entries of this config string. Note that this is just for backup, replication does not require this. -->
<!-- <str name="backupAfter">optimize</str> --> <!--If configuration files need to be replicated give the names here, separated by comma -->
<str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str>
<!--The default value of reservation is 10 secs.See the documentation below . Normally , you should not need to specify this -->
<str name="commitReserveDuration">00:00:10</str>
</lst>
</requestHandler>

1)replicateAfter可取startup、commit、optimize,表示触发复制的时机。使用中,这三个值都可以配上。
2)backupAfter表示备份时机,如果需要备份,solr会在配置的时机自动生成备份。
3)confFiles表示在复制时需要复制到slave的文件列表。
4)commitReserveDuration默认是10秒,这个值通常你通常不需要修改,除非你的网络慢到传输5M数据需要10秒以上的时间。

2.从机SolrConfig.xml

<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="slave"> <!--fully qualified url for the replication handler of master . It is possible to pass on this as a request param for the fetchindex command-->
<str name="masterUrl">http://master_host:port/solr/corename/replication</str> <!--Interval in which the slave should poll master .Format is HH:mm:ss . If this is absent slave does not poll automatically.
But a fetchindex can be triggered from the admin or the http API -->
<str name="pollInterval">00:00:20</str>
<!-- THE FOLLOWING PARAMETERS ARE USUALLY NOT REQUIRED-->
<!--to use compression while transferring the index files. The possible values are internal|external
if the value is 'external' make sure that your master Solr has the settings to honour the accept-encoding header.
see here for details http://wiki.apache.org/solr/SolrHttpCompression
If it is 'internal' everything will be taken care of automatically.
USE THIS ONLY IF YOUR BANDWIDTH IS LOW . THIS CAN ACTUALLY SLOWDOWN REPLICATION IN A LAN-->
<str name="compression">internal</str>
<!--The following values are used when the slave connects to the master to download the index files.
Default values implicitly set as 5000ms and 10000ms respectively. The user DOES NOT need to specify
these unless the bandwidth is extremely low or if there is an extremely high latency-->
<str name="httpConnTimeout">5000</str>
<str name="httpReadTimeout">10000</str> <!-- If HTTP Basic authentication is enabled on the master, then the slave can be configured with the following -->
<str name="httpBasicAuthUser">username</str>
<str name="httpBasicAuthPassword">password</str>
</lst>
</requestHandler>

说明:上面的参数也不需要太多解释,其中pollInterval参数表明slave从master复制数据的频率。

如果对实时性要求不高,通常5-10分钟即可,也避免slave的indexsearcher频繁的切换,同时,master的commit频率也可相对保持一致。

HTTP API

solr的ReplicationHandler提供了一系列http命令(参数command),支持的可选值如下:

1)indexversion:slave从master获取最新的索引点信息。

2)filecontent:slave从master下载指定文件的内容。

3)filelist:slave从master获取指定indexversion的索引文件列表(及需要复制的配置文件)。

4)backup:备份索引。如果担心索引有损坏的可能性,可以定期备份索引。

5)fetchindex:手动复制数据,和slave自动复制相当。

6)disablepoll:停止slave的复制。

7)enablepoll:开启slave的复制。

8)abortfetch:终止slave上正在进行的下载文件过程。

9)commits:show当前仍旧保留的IndexCommit信息。

10)details:show slave当前的复制细节信息。

11)enablereplication:启动master对所有slave的复制功能

12)disablereplication:关闭master对所有slave的复制功能

Solr配置集群的更多相关文章

  1. Solr主从集群配置简要说明

    关于solr的集群主要分为主从和SolrCloud两种.主从,比较适合以读为主的场景.SolrCloud适合数据量大,时不时会有更新的情形.那么solr的主从配置很简单.在solrconfig.xml ...

  2. Solr的集群搭建(索引库)

    Solr的集群的搭建 Solr集群原理 SolrCloud概念以及结构 概念: SolrCloud(Solr云)是Solr提供的分布式搜索方案,当你需要大规模,容错,分布式索引和检索能力时使用Solr ...

  3. Centos7:solr伪集群(SolrCloud)搭建

    JDK,tocmat环境搭建 zookeeper集群安装 解压缩zookeeper的压缩包 创建data目录 复制zoo_sample.cfg为zoo.cfg 修改confg/zoo.cfg中 dat ...

  4. Redis配置集群二(window)

    第一篇那redis的基础命令都差不多讲了一遍了,这篇就将怎么配置集群了,最后要达到的效果是一台主redis,还有几台从的redis,每次数据都是同步的,当主redis挂掉了,那么就会从几台从redis ...

  5. 图文解说:Nginx+tomcat配置集群负载均衡

    图文解说:Nginx+tomcat配置集群负载均衡 博客分类: appserver nginxTomcatUbuntuLinux网络应用  作者:niumd Blog:http://ari.iteye ...

  6. 转】Nginx+tomcat配置集群负载均衡

    原博文出自于:http://blog.csdn.net/bruce_6/article/details/38228299         感谢! 相信很多人都听过nginx,这个小巧的东西慢慢地在吞食 ...

  7. 配置集群Nginx+Memcached+Tomcat集群配置

    上班之余抽点时间出来写写博文,希望对新接触的朋友有帮助.今天在这里和大家一起学习一下配置集群 1.   Nginx Nginx是通过将多个Web Server绑定到同一个IP地址下,以实现多个WebS ...

  8. weblogic配置集群(二)

    接到上一篇博文来 weblogic配置集群(一) 三.启动管理server 按照上面的方式创建好域后,在D:\Oracle\Middleware\user_projects\domains\gszhD ...

  9. weblogic配置集群(一)

    一.程序安装 二.创建域 好的  篇幅太长  我就接下来的操作就写在下一篇博客了 weblogic配置集群(二)

随机推荐

  1. 检查网口流量与前10名流量大IP

    此脚本包含的功能有: 1.实时监控任意网卡的流量 2.统计10秒内平均流量 3.统计每个端口在10秒内的平均流量,基于客户端和服务端端口统计.可以看出哪些端口占流量比较大,对于web服务器,一般是80 ...

  2. hdu 5074 Hatsune Miku

    http://acm.hdu.edu.cn/showproblem.php?pid=5074 题意:给你一个的矩阵score[i][j],然后给你一个数列,数列中有一些是-1,代表这个数可以换成1~m ...

  3. linux下so动态库一些不为人知的秘密(转)

    linux 下有动态库和静态库,动态库以.so为扩展名,静态库以.a为扩展名.二者都使用广泛.本文主要讲动态库方面知识.基本上每一个linux 程序都至少会有一个动态库,查看某个程序使用了那些动态库, ...

  4. .net线程入门1-进程

    什么是进程 当用户启动了一个程序,这个程序会加载内存和一大堆的资源,这些内存和资源在物理上的分区就是一个进程.一个应用程序也许不仅仅包含一个进程,了解程序和进程不是同一回事是非常重要的. 你可以通过任 ...

  5. 【video】m3u8

    Safari浏览器识别不了.UC浏览器可以识别. 优酷的Safari浏览器和UC浏览器都可以识别.

  6. 【转】Android:Layout_weight的深刻理解

    原文网址:http://mobile.51cto.com/abased-375428.htm 本文详细介绍了Android布局中Layout_weight的属性,它是用来分配属于空间的一个属性,你可以 ...

  7. 算法优化(动态规划):COGS 2009. [USACO Mar09]餐厅清扫

    2009. [USACO Mar09]餐厅清扫 ★★☆   输入文件:cleanup.in   输出文件:cleanup.out   简单对比时间限制:1 s   内存限制:256 MB [题目描述] ...

  8. 【最短路】NEERC15 F Froggy Ford(2015-2016 ACM-ICPC)(Codeforces GYM 100851)

    题目链接: http://codeforces.com/gym/100851 题目大意: 一只青蛙跳过宽为W的河,河中游N个石头,坐标xi,yi,现在往河中间添加一个石头,使得每次跳跃的最大的距离最小 ...

  9. 【线段树】BAPC2014 E Excellent Engineers (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  10. poj2774 Long Long Message(后缀数组)

    [题目链接] http://poj.org/problem?id=2774 [题意] A & B的最长公共子序列. [思路] 拼接+height数组.将AB拼接成一个形如A$B的串,枚举hei ...