[solr] 请教关于solr的部署设计问题
rinch0912
2011-07-01
大家好,我刚接触solr,正在学习中。现在想请教大家个问题。
前提环境:关于solr的Master-Slave分布式部署,我现在在同一台服务器上建立了不同的站点,来实现Master端和Slave端,两个站点使用不同的索引文件,索引文件也是定时复制,只是存在不同的目录下。这样为了避免创建索引和搜索操作同时进行时,对效率的影响。 问题:能不能将Master本身也作为一个Slave端来使用呢? 现在在服务器上已经有两份索引了,而且是定期复制来达到同步的。能不能通过一定配置或者其他手段,让Master的索引文件也参与到搜索工作呢?这样的话,就相当与有两个Slave端,可以通过软件实现负载均衡。 |
|
illu
2011-07-01
Setting up a Repeater
A master may be able to serve only so many slaves without affecting performance. Some organizations have deployed slave servers across multiple data centers. If each slave downloads the index from a remote data center, the resulting download may consume too much network bandwidth. To avoid performance degradation in cases like this, you can configure one or more slaves as repeaters. A repeater is simply a node that acts as both a master and a slave. To configure a server as a repeater, both the master and slave configuration lists need to be present inside the ReplicationHandler requestHandler in the solrconfig.xml file. Be sure to have replicateAfter 'commit' setup on repeater even if replicateAfter is set to optimize on the main master. This is because on a repeater (or any slave), only a commit is called after index is downloaded. Optimize is never called on slaves. Optionally, one can configure the repeater to fetch compressed files from the master through the 'compression' parameter (see 'slave' section for details) to reduce the index download time. Example configuration of a repeater: <requestHandler name="/replication" class="solr.ReplicationHandler"> <lst name="master"> <str name="replicateAfter">commit</str> <str name="confFiles">schema.xml,stopwords.txt,synonyms.txt</str> </lst> <lst name="slave"> <str name="masterUrl">http://master.solr.company.com:8080/solr/replication</str> <str name="pollInterval">00:00:60</str> </lst> </requestHandler> |
|
rinch0912
2011-07-04
illu 写道 Setting up a Repeater
A master may be able to serve only so many slaves without affecting performance. Some organizations have deployed slave servers across multiple data centers. If each slave downloads the index from a remote data center, the resulting download may consume too much network bandwidth. To avoid performance degradation in cases like this, you can configure one or more slaves as repeaters. A repeater is simply a node that acts as both a master and a slave. To configure a server as a repeater, both the master and slave configuration lists need to be present inside the ReplicationHandler requestHandler in the solrconfig.xml file. Be sure to have replicateAfter 'commit' setup on repeater even if replicateAfter is set to optimize on the main master. This is because on a repeater (or any slave), only a commit is called after index is downloaded. Optimize is never called on slaves. Optionally, one can configure the repeater to fetch compressed files from the master through the 'compression' parameter (see 'slave' section for details) to reduce the index download time. Example configuration of a repeater: <requestHandler name="/replication" class="solr.ReplicationHandler"> <lst name="master"> <str name="replicateAfter">commit</str> <str name="confFiles">schema.xml,stopwords.txt,synonyms.txt</str> </lst> <lst name="slave"> <str name="masterUrl">http://master.solr.company.com:8080/solr/replication</str> <str name="pollInterval">00:00:60</str> </lst> </requestHandler> 很感谢。但是我没有太明白,你能不能描述的更清楚一点? 既然master和slave在一起,为什么还要配置<str name="pollInterval">00:00:60</str>呢?难道使用不是同一份索引文件吗? |