Solr主从集群配置简要说明
来源:互联网 发布:ubuntu安装nodejs 编辑:程序博客网 时间:2024/05/22 06:24
文章转自:http://www.cnblogs.com/likehua/p/4353354.html
关于solr的集群主要分为主从和SolrCloud两种。主从,比较适合以读为主的场景。SolrCloud适合数据量大,时不时会有更新的情形。那么solr的主从配置很简单。在solrconfig.xml中找到 <requestHandler name="/replication" class="solr.ReplicationHandler" > 。这里的replication主要解决主从复制的。它主要实现:在主进行数据写操作,在slave节点进行读操作。当并发量大些,可以通过扩展slave节点数来应对,多个slave做一个反向代理和负载均衡(在本文中,就不做说明了,如有需要,可以使用nginx或者apache等负载软件),供查询使用。好了,先看看主节点配置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<requestHandler name=
"/replication"
class
=
"solr.ReplicationHandler"
>
<!--
To enable simple master/slave replication, uncomment one of the
sections below, depending on whether
this
solr instance should be
the
"master"
or a
"slave"
. If
this
instance is a
"slave"
you will
also need to fill in the masterUrl to point to a real machine.
-->
<lst name=
"master"
>
<str name=
"replicateAfter"
>commit</str>
<str name=
"replicateAfter"
>startup</str>
<str name=
"confFiles"
>schema.xml,stopwords.txt,spellings.txt,synonyms.txt</str>
</lst>
<!--
<lst name=
"slave"
>
<str name=
"masterUrl"
>http:
//your-master-hostname:8983/solr</str>
<str name=
"pollInterval"
>
00
:
00
:
60
</str>
</lst>
-->
1
master 标志该core 为主节点。复制的行为发生在commit、startup之后。cofFiles表示,向从节点复制的配置文件(记住,主从的solrconfig.xml配置不一样,不要把solrconfig.xml也复制到从节点了)。<br><br> 再看看slave节点的配置,slave配置很简单,把上面的配置文件中master那段注释掉。把slave那段放开即可。将masterUrl换成master的url,格式:http:
//your-master-host:port/solr/your_core_name。具体配置如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<requestHandler name=
"/replication"
class
=
"solr.ReplicationHandler"
>
<!--
To enable simple master/slave replication, uncomment one of the
sections below, depending on whether
this
solr instance should be
the
"master"
or a
"slave"
. If
this
instance is a
"slave"
you will
also need to fill in the masterUrl to point to a real machine.
-->
<!--
<lst name=
"master"
>
<str name=
"replicateAfter"
>commit</str>
<str name=
"replicateAfter"
>startup</str>
<str name=
"confFiles"
>schema.xml,stopwords.txt</str>
</lst>
-->
<lst name=
"slave"
>
<str name=
"masterUrl"
>http:
//192.9.104.116:8090/solr/POI</str>
<str name=
"pollInterval"
>
00
:
00
:
20
</str>
</lst>
</requestHandler>
pollInterval 表示多久向master同步一次数据,数据格式{时}:{分}:{秒}。这个要根据你的业务场景。如果更新比较频繁,就把这个值调小点,反之,就调大些。在同步数据时,根据网络和机器配置等不同,slave之间的数据会存在不同步的情况。如果,你对此有要求,需要注意了。总之,任何一种集群方案都不是万能的。solr的主从模式目前存在诸多问题,比如:主节点有单点故障等等,希望后续的版本会有些改进。
0 0
- Solr主从集群配置简要说明
- Solr主从集群复制
- solr 主从集群2
- solr主从配置
- solr主从配置
- Solr主从配置
- solr主从配置
- Solr主从配置
- solr集群配置中遇到的问题及说明
- log4j配置简要说明
- WebConfig配置简要说明
- fckeditor简要配置说明
- log4j 配置简要说明
- Solr集群配置
- solr集群详细配置
- solr服务器主从的配置
- solr主从配置备份数据
- solr 主从集群出现的问题
- MFC调用WPF函数
- HTTP Basic Authentication in JMeter
- DirectX 介绍
- 01背包问题和完全背包问题
- Java NIO 和IO 对比
- Solr主从集群配置简要说明
- Android自定义View
- PHP+jquery实现的三级联动
- wdcp的一个安全漏洞
- 机器视觉(相机、镜头、光源)全面概括
- 仿ios可上提下拉的ScrollView
- Python的私有化
- python爬虫(二):向网页提交数据
- 机器学习实践 测试驱动的开发方法——互动出版网