如何使用两个搜索服务器设置Solr Cloud? [英] How to setup Solr Cloud with two search servers?

查看:120
本文介绍了如何使用两个搜索服务器设置Solr Cloud?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用sunspot solr开发Rails项目并配置Solr Cloud. 我的环境:rails 3.2.1,ruby 2.1.2,sunspot 2.1.0,Solr 4.1.6.

Hi I'm developing rails project with sunspot solr and configuring Solr Cloud. My environment: rails 3.2.1, ruby 2.1.2, sunspot 2.1.0, Solr 4.1.6.

为什么使用SolrCloud:我需要更稳定的系统-通常搜索服务器需要维护,而Web应用程序将停止生产.因此,我考虑如何制作两台相同的搜索服务器,而不是一台,以使系统更稳定:如果一台服务器宕机,另一台将继续工作.

Why SolrCloud: I need more stable system - oftentimes search server goes on maintenance and web application stop working on production. So, I think about how to make 2 identical search servers instead of one, to make system more stable: if one server will be down, other will continue working.

我找不到任何简单,易于理解且详细说明的优秀教程... 我试图在两台服务器上设置SolrCloud,但我不完全了解它在内部的工作方式:

I cannot find any good turtorial with simple, easy to understand and described in details turtorial... I'm trying to set up SolrCloud on two servers, but I do not fully understand how it is working inside:

  • 在两个服务器之间同步数据(这是自动操作吗?)
  • 平衡两个服务器之间的搜索请求
  • 当一台服务器突然停止工作时,另一台服务器应成为主服务器(这是自动动作吗?)
  • 除了列出的功能以外,还有SolrCloud功能吗?

推荐答案

在此处详细了解SolrCloud. https://wiki.apache.org/solr/SolrCloud

Read more about SolrCloud here..! https://wiki.apache.org/solr/SolrCloud

结合我的经验.

如果您的应用程序只是从SOLR读取数据而没有写入SOLR(实时,但是您使用ETL或类似的索引),那么您就可以使用Master Slave层次结构.

If your application just reads data from SOLR and does not write to SOLR(in real time but you index using an ETL or so) then you can just go for Master Slave hierarchy.

定义一个Master:-将所有写入此处.如果该主服务器宕机,您将无法再为数据建立索引

Define one Master :- Point all writes to here. If this master is down you will no longer be able to index the data

创建2个(或更多)从站:-这是SOLR的一项功能,它将根据我们指定的间隔(每20秒说一次)来同步来自主站的数据

Create 2(or more) Slaves :- This is an feature from SOLR and it will take care of synchronizing data from the master based on the interval we specify(Say every 20 seconds)

基于从属服务器创建负载均衡器,并指向您的应用程序以从负载均衡器读取数据.

Create a load balancer based out of slaves and point your application to read data from load balancer.

优点: 通过上述设置,您对主服务器(数据写入)的可用性不高,但是在最后一个从服务器故障之前,数据将具有高可用性.

Pros: With above setup, you don't have high availability for Master(Data writes) but you will have high availability for data until the last slave goes down.

缺点: 假设一个奴隶掉下来,一个小时后您将其买回,那么这个奴隶将落后另一个奴隶一个小时.因此,它的手动任务是在添加回ELB之前检查其他从站之间的数据一致性.

Cons: Assume one slave went down and you bought it back after an hour, this slave will be behind the other slaves by one hour. So its manual task to check for data consistency among other slaves before adding back to ELB.

SolrCloud怎么样?

How about SolrCloud?

  1. 这里没有Master,因此您也可以实现Writes的高可用性
  2. 如上所述,无需担心数据不一致,SolrCloud架构将解决此问题.

最适合您的东西.

  1. 定义具有3个节点Quorom的外部Zookeeper
  2. 至少定义2个SOLR服务器.
  3. 将当前索引"拆分为2个分片(默认情况下,每个分片将在步骤2中定义的2个solr节点中每个驻留一个)
  4. 将副本定义为2(这将为每个节点中的分片创建副本)
  5. 定义LB以指向上方的solr节点.
  6. 将您的Solr输入和应用程序指向此LB.

通过以上设置,您可以维持两个节点的故障转移.

By above setup, you can sustain fail over for either nodes.

如果您需要更多信息,请告诉我.

Let me know if you need more info on this.

此致

Aneesh N

-让我们一起学习.

这篇关于如何使用两个搜索服务器设置Solr Cloud?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆