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配置集群(二)
随机推荐
- jQuery常用特效插件汇总
jquery的CDN引用及下载地址 http://www.bootcdn.cn/jquery/ 1:semantictabs.js可以简单地制作Tabs菜单2:tabBox.js可以非常简单方便地 ...
- HDU1106
为了给学弟学妹讲课,我又水了一题-- 1: import java.util.*; 2: import java.io.*; 3: 4: public class HDU1106 5: { 6: pu ...
- 2句代码轻松实现WPF最大化不遮挡任务栏并且具有边框调节效果
原文:2句代码轻松实现WPF最大化不遮挡任务栏并且具有边框调节效果 相信刚入门的菜鸟跟我一样找遍了百度谷歌解决最大化遮挡任务栏的方法大多方法都是HOOK一大堆API声明 最近在敲代码的时候无意中发现有 ...
- 我的VSTO之路(五):Outlook初步开发之联系人扩展
原文:我的VSTO之路(五):Outlook初步开发之联系人扩展 上一讲我们完成对Word的介绍,文本开始,我将着重介绍Outlook.Outlook是微软Office中一个非常实用的工具,尤其在一个 ...
- 几个Uboot命令
1 nand scrub 这个命令会擦除坏块信息,将坏块标识成好的,但此时这个坏块有潜在有危险,在特定条件下仍会造成数据的丢失,所以应该谨慎使用. Run U-boot and then use th ...
- POJ3126 Prime Path(BFS)
题目链接. AC代码如下: #include <iostream> #include <cstdio> #include <cstring> #include &l ...
- 解决weblogic Managed Server启动非常慢的情况
jdk版本:1.7.0_79 查看控制台日志停留在如下地方: . . JAVA Memory arguments: -Xms2048m -Xmx4096m -XX:MaxPermSize=512m . ...
- HDOJ(HDU) 2162 Add ‘em(求和)
Problem Description Write a program to determine the summation of several sets of integers. Input Th ...
- PostgreSQL安装详细步骤(windows)
原文地址:http://blog.chinaunix.net/uid-354915-id-3498734.html PostgreSQL安装:一.windows下安装过程安装介质:postgresql ...
- 将对象格式的style转换为字符串格式
var style = { position:'absolute', background:'red', width:'2px', height:'2px', color:'#fff', top:x, ...