Solr配置集群
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配置集群的更多相关文章
- Solr主从集群配置简要说明
关于solr的集群主要分为主从和SolrCloud两种.主从,比较适合以读为主的场景.SolrCloud适合数据量大,时不时会有更新的情形.那么solr的主从配置很简单.在solrconfig.xml ...
- Solr的集群搭建(索引库)
Solr的集群的搭建 Solr集群原理 SolrCloud概念以及结构 概念: SolrCloud(Solr云)是Solr提供的分布式搜索方案,当你需要大规模,容错,分布式索引和检索能力时使用Solr ...
- Centos7:solr伪集群(SolrCloud)搭建
JDK,tocmat环境搭建 zookeeper集群安装 解压缩zookeeper的压缩包 创建data目录 复制zoo_sample.cfg为zoo.cfg 修改confg/zoo.cfg中 dat ...
- Redis配置集群二(window)
第一篇那redis的基础命令都差不多讲了一遍了,这篇就将怎么配置集群了,最后要达到的效果是一台主redis,还有几台从的redis,每次数据都是同步的,当主redis挂掉了,那么就会从几台从redis ...
- 图文解说:Nginx+tomcat配置集群负载均衡
图文解说:Nginx+tomcat配置集群负载均衡 博客分类: appserver nginxTomcatUbuntuLinux网络应用 作者:niumd Blog:http://ari.iteye ...
- 转】Nginx+tomcat配置集群负载均衡
原博文出自于:http://blog.csdn.net/bruce_6/article/details/38228299 感谢! 相信很多人都听过nginx,这个小巧的东西慢慢地在吞食 ...
- 配置集群Nginx+Memcached+Tomcat集群配置
上班之余抽点时间出来写写博文,希望对新接触的朋友有帮助.今天在这里和大家一起学习一下配置集群 1. Nginx Nginx是通过将多个Web Server绑定到同一个IP地址下,以实现多个WebS ...
- weblogic配置集群(二)
接到上一篇博文来 weblogic配置集群(一) 三.启动管理server 按照上面的方式创建好域后,在D:\Oracle\Middleware\user_projects\domains\gszhD ...
- weblogic配置集群(一)
一.程序安装 二.创建域 好的 篇幅太长 我就接下来的操作就写在下一篇博客了 weblogic配置集群(二)
随机推荐
- ROR入门之旅
mac上为了不在登录画面看到其他账户,我禁用了root账户,而每次用Terminal的时候,先获得sudo账户的权限: sudo -s mac本身就安装有ruby ruby -v 查看当前安装的rub ...
- Java实现Qt的SIGNAL-SLOT机制
SIGNAL-SLOT是Qt的一大特色,使用起来十分方便.在传统的AWT和Swing编程中,我们都是为要在 监听的对象上添加Listener监听器.被监听对象中保存有Listener的列表,当相关事件 ...
- MFC中菜单栏使用
1.新建项目: 选择MFC应用程序,应用程序类型选择“基于对话框”: 本文中项目名为:MenuTest 2.新建菜单栏资源: 找到资源视图,右键MenuTest.re选择“添加资源”——选择Menu, ...
- Vi的几种退出方式
1.q 退出 2.w 保存,继续操作 3.wq 保存退出 4.q! 不保存,放弃修改 5.x 同wq相似,但又有区别 wq 强制性写入文件并退出.即使文件没有被修改也强制写入,并更新文件的修改时间 ...
- phpMyAdmin view_create.php 跨站脚本漏洞
漏洞名称: phpMyAdmin view_create.php 跨站脚本漏洞 CNNVD编号: CNNVD-201307-066 发布时间: 2013-07-05 更新时间: 2013-07-05 ...
- 【Mongous】
amark/mongous Mongous - 一个轻量级的nodejs mongodb驱动 mongous,是我不够懂你吗?关于mongous不支持objectId查询 mongous 不需要 _i ...
- weblogic启动报错之未修改hosts产生错误
报错如下: Enter username to boot WebLogic server:weblogic Enter password to boot WebLogic server: <Ju ...
- Light OJ 1004 - Monkey Banana Problem(DP)
题目大意: 给你一菱形的数字阵,问从最上面走到最下面所能获得的最大值是多少? #include<cstdio> #include<cstring> #include<io ...
- Combination Sum —— LeetCode
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C wher ...
- 【java基础】--(3)javaIO详细阐释
1.总的4类 字符:Reader 和Writer 字节:InputStream和OutputStream 2.Reader 六个子类BufferedReader, CharArrayReader, F ...