当前位置: 首页 > 编程日记 > 正文

solrcloud Read and Write Side Fault Tolerance

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

SolrCloud supports elasticity, high availability, and fault tolerance in reads and writes. What this means, basically, is that when you have a large cluster, you can always make requests to the cluster: Reads will return results whenever possible, even if some nodes are down, and Writes will be acknowledged only if they are durable; i.e., you won't lose data.

Read Side Fault Tolerance

In a SolrCloud cluster each individual node load balances read requests across all the replicas in collection. You still need a load balancer on the 'outside' that talks to the cluster, or you need a smart client which understands how to read and interact with Solr's metadata in ZooKeeper and only requests the ZooKeeper ensemble's address to start discovering to which nodes it should send requests. (Solr provides a smart Java SolrJ client called CloudSolrClient.)

Even if some nodes in the cluster are offline or unreachable, a Solr node will be able to correctly respond to a search request as long as it can communicate with at least one replica of every shard, or one replica of every relevant shard if the user limited the search via the 'shards' or '_route_' parameters. The more replicas there are of every shard, the more likely that the Solr cluster will be able to handle search results in the event of node failures.

zkConnected

A Solr node will return the results of a search request as long as it can communicate with at least one replica of every shard that it knows about, even if it can not communicate with ZooKeeper at the time it receives the request. This is normally the preferred behavior from a fault tolerance standpoint, but may result in stale or incorrect results if there have been major changes to the collection structure that the node has not been informed of via ZooKeeper (ie: shards may have been added or removed, or split into sub-shards)

zkConnected header is included in every search response indicating if the node that processed the request was connected with ZooKeeper at the time:

Solr Response with partialResults

{

  "responseHeader": {

    "status": 0,

    "zkConnected": true,

    "QTime": 20,

    "params": {

      "q": "*:*"

    }

  },

  "response": {

    "numFound": 107,

    "start": 0,

    "docs": [ ... ]

  }

}

shards.tolerant

In the event that one or more shards queried are completely unavailable, then Solr's default behavior is to fail the request. However, there are many use-cases where partial results are acceptable and so Solr provides a boolean shards.tolerant parameter (default 'false'). If shards.tolerant=true then partial results may be returned. If the returned response does not contain results from all the appropriate shards then the response header contains a special flag called 'partialResults'. The client can specify 'shards.info' along with the 'shards.tolerant' parameter to retrieve more fine-grained details.

Example response with partialResults flag set to 'true':

Solr Response with partialResults

{

  "responseHeader": {

    "status": 0,

    "zkConnected": true,

    "partialResults": true,

    "QTime": 20,

    "params": {

      "q": "*:*"

    }

  },

  "response": {

    "numFound": 77,

    "start": 0,

    "docs": [ ... ]

  }

}

Write Side Fault Tolerance

SolrCloud is designed to replicate documents to ensure redundancy for your data, and enable you to send update requests to any node in the cluster.  That node will determine if it hosts the leader for the appropriate shard, and if not it will forward the request to the the leader, which will then forward it to all existing replicas, using versioning to make sure every replica has the most up-to-date version.  If the leader goes down, another replica can take its place. This architecture enables you to be certain that your data can be recovered in the event of a disaster, even if you are using Near Real Time Searching.

Recovery

A Transaction Log is created for each node so that every change to content or organization is noted. The log is used to determine which content in the node should be included in a replica. When a new replica is created, it refers to the Leader and the Transaction Log to know which content to include. If it fails, it retries.

Since the Transaction Log consists of a record of updates, it allows for more robust indexing because it includes redoing the uncommitted updates if indexing is interrupted.

If a leader goes down, it may have sent requests to some replicas and not others. So when a new potential leader is identified, it runs a synch process against the other replicas. If this is successful, everything should be consistent, the leader registers as active, and normal actions proceed. If a replica is too far out of sync, the system asks for a full replication/replay-based recovery.

If an update fails because cores are reloading schemas and some have finished but others have not, the leader tells the nodes that the update failed and starts the recovery procedure.

Achieved Replication Factor

When using a replication factor greater than one, an update request may succeed on the shard leader but fail on one or more of the replicas. For instance, consider a collection with one shard and a replication factor of three. In this case, you have a shard leader and two additional replicas. If an update request succeeds on the leader but fails on both replicas, for whatever reason, the update request is still considered successful from the perspective of the client. The replicas that missed the update will sync with the leader when they recover.

Behind the scenes, this means that Solr has accepted updates that are only on one of the nodes (the current leader). Solr supports the optional min_rf parameter on update requests that cause the server to return the achieved replication factor for an update request in the response. For the example scenario described above, if the client application included min_rf >= 1, then Solr would return rf=1 in the Solr response header because the request only succeeded on the leader. The update request will still be accepted as the min_rf parameter only tells Solr that the client application wishes to know what the achieved replication factor was for the update request. In other words, min_rf does not mean Solr will enforce a minimum replication factor as Solr does not support rolling back updates that succeed on a subset of replicas.

On the client side, if the achieved replication factor is less than the acceptable level, then the client application can take additional measures to handle the degraded state. For instance, a client application may want to keep a log of which update requests were sent while the state of the collection was degraded and then resend the updates once the problem has been resolved. In short, min_rf is an optional mechanism for a client application to be warned that an update request was accepted while the collection is in a degraded state.

转载于:https://my.oschina.net/u/172871/blog/854106

相关文章:

XML的二十个热点问题

http://www.netqu.com 中华技术网会员 Wuxuehui 发布翻译:Chen Zhihong 编辑:孙一中这些日子,几乎每个人都在谈论XML (Extensible Markup Language),但是很少有人真正理解其含义。XML的推崇者认为它能够解决所有HTML不能解决的问题&#xff0…

5G+云网融合,移动云带领开发者释放边缘计算的力量

在5G浪潮的驱动下,智能设备、自动驾驶、VR/AR等对于实时性、本地性有着较强需求的场景日益丰富,边缘计算应运而生,有效提升了用户体验。众所周知,边缘计算技术的突破,意味着许多控制将通过本地设备实现而无需交由云端&…

Linux下模拟RAID5实现磁盘损坏,数据自动切换到备份磁盘上

另一个博客地址:www.rsyslog.org Linux社区 RAID5磁盘配额, 1块磁盘,分5个分区模拟5块磁盘,其中4个做成RAID5分区,剩余一个作为冗余磁盘,挂载到/data1目录,模拟其中一块磁盘损坏,冗…

jsp9大内置对象

转载于:https://www.cnblogs.com/xtdxs/p/6523059.html

RHCSA 解析-01

这是RHCSA题目开始正式做题前的准备部分。 后面会陆续连载部分类似的题型极其解法。 考试时间:RHCSA 2.5小时 总分300分,210分pass考试环境:考试为上机考试,在一台真实机系统中,已经预安装好虚拟机,要求所…

关于Visual C#装箱与拆箱的研究

关于Visual C#装箱与拆箱的研究2004-09-15 作者: 出处: CSDN在对这个问题展开讨论之前,我们不妨先来问这么几个问题,以系统的了解我们今天要探究的主题。观者也许曾无数次的使用过诸如System.Console类或.NET类库中那些品种繁多的…

Imagination推出全新多核GPU IP系列:提供33种不同配置,AI算力达24 TOPS

近日,致力于打造半导体和软件知识产权(IP) Imagination Technologies宣布推出全新的IMG B系列(IMG B-Series)图形处理器(GPU),进一步扩展了其GPU知识产权(IP)…

ES6: 字符串

现在ES6增加了很多的字符串的方法,但是有些感觉自己也不是很懂,所以就罗列了一些平常的用的。 includes, startsWith, endsWith includes(): 返回布尔值,表示是否找到了参数字符串;startsWith(): 返回布尔值…

警惕!新版Net Transport(影音传送带)安装有猫腻

http://article.pcpop.com/show.aspx?topic_id1317935由于早些时候FlashGet和NetAnts(网络蚂蚁)迟迟没有新版本发布,Net Transport(影音传送带)趁虚而入,以免费且支持流媒体下载迅速获得了网民的青睐。不过…

我是一个平平无奇的AI神经元

来源 | 编程技术宇宙责编 | 晋兆雨头图 | CSDN付费下载自视觉中国我是一个AI神经元我是一个AI神经元,刚刚来到这个世界上,一切对我来说都特别新奇。之所以叫这个名字,是因为我的工作有点像人类身体中的神经元。人体中的神经元可以传递生物信号…

mysql的越过用户权限表登录

mysql的越过用户权限表登录昨天突然有个朋友对了说,不小心把mysql数据库的mysql库的user表给误删了,让我帮帮他。当是我就想到了越过用户权限表启动服务的选项skip-grant-table.自己也实验了一把,以前只知道有这样的方法,但一直没…

互联网引发全面深刻产业变革

2019独角兽企业重金招聘Python工程师标准>>> 当前,互联网已经渗透到社会生产生活各个方面,深刻改变着人类社会运行方式,加速着人类文明进步的步伐,开启了一个崭新的时代。互联网革命是人类发展史上历次科技革命的发展和…

apache模块

核心功能和多路处理模块 core Apache HTTP服务器核心提供的功能,始终有效。 mpm_common 收集了被多个多路处理模块(MPM)实现的公共指令。 beos 专门针对BeOS优化过的多路处理模块(MPM) event 一个标准workerMPM的实验性变种。 mpm_netware Novell NetWare优化过的线…

如何实现iframe(嵌入式帧)的自适应高度

好几次看到有人提问问到如何实现 iframe 的自适应高度,能够随着页面的长度自动的适应以免除页面和 iframe 同时出现滚动条的现象,刚好我在工作中也碰到了类似问题,于是上网翻查,东抄抄西看看,弄出来这么一个函数&#…

拖拉机也将自动驾驶,日本劳动力短缺大力发展无人农业

来源 | HyperAI超神经责编 | 晋兆雨头图 | CSDN付费下载自视觉中国内容提要:为解决农业劳动力短缺问题,日本近年来涌现出自动收割机、插秧机等自动化农业设备。近日,其农机生产商久保田,也宣布与英伟达联手,将推出自动…

php字符串操作

1.字符串的格式化 按照从表单提交数据之后,php处理的不同:接受,显示,存储。也有三种类型的格式化方法。 1.1字符串的接收之后的整理: trim(),ltrim(),rtrim() 当数据从表单中上传上来的时候需要对字符串整理一下,去掉字…

javascript事件列表解说

javascript事件列表解说事件浏览器支持解说一般事件onclickIE3、N2 鼠标点击时触发此事件ondblclickIE4、N4 鼠标双击时触发此事件onmousedownIE4、N4 按下鼠标时触发此事件onmouseupIE4、N4 鼠标按下后松开鼠标时触发此事件onmouseoverIE3、N2 当鼠标移动到某对象范围的上方时…

Facebook如何预测广告点击:剖析经典论文GBDT+LR

作者 | 梁唐来源 | TechFlow今天我们来剖析一篇经典的论文:Practial Lessons from Predicting Clicks on Ads at Facebook。从这篇paper的名称当中我们可以看得出来,这篇paper的作者是Facebook的广告团队。这是一篇将GBDT与LR模型结合应用在广告点击率预…

centos lustre 简单 安装教程

Lustre是一个大规模的、安全可靠的,具备高可用性的集群文件系统,它是由SUN公司开发和维护的。 该项目主要的目的就是开发下一代的集群文件系统,可以支持超过10000个节点,数以PB的数据量存储系统。 因为业务需要,需要做…

安装flash

网校客服124说: 2017-03-11 18:37:39网校客服124说: 2017-03-11 18:37:48您好,您可以安装这个插件试一下http://www.chinaacc.com/downcenter/网校客服124说: 2017-03-11 18:38:04下载后安装时请关闭所有的浏览器。我说: 2017-03-11 18:40:08转载于:https://blo…

左右漂浮的广告代码

引用JS文件的代码&#xff1a; <script language"javascript" src"****.js"></script> <---- var delta0.15 var collection; function floaters() { this.items []; this.addItem function(id,x,y,content) { document.wri…

韩辉:国产操作系统的最大难题在于解决“生产关系”

作者 | 高卫华编辑 | Just出品 | AI科技大本营&#xff08;ID&#xff1a;rgznai100&#xff09;操作系统是所有软件体系的基础&#xff0c;而随着中国物联网产业的迅猛发展&#xff0c;诸多国产嵌入式操作系统开始跃出水面。其中之一包括 SylixOS&#xff0c;这是一款由国内企…

java中运用label跳转

2019独角兽企业重金招聘Python工程师标准>>> goto是java的保留词&#xff0c;但java里并没有goto. goto可以随心所欲地在代码里跳转&#xff0c;看似很方便&#xff0c;但带来的代码混乱成为其被人诟病的原因。 然而有些时候必要的goto可以带来很大的方便。所以jav…

【转】超简单利用UGUI制作圆形小地图

http://sanwen.net/a/ithhtbo.html 由于UI都是Achor自己用PS做的&#xff0c;比较粗糙&#xff0c;大家见谅&#xff0c;不过丝毫不影响功能的实现&#xff0c;下面我们看看今天的笔记&#xff1a; 首先我们看看需要哪些组件&#xff1a; 1.在Canvas画布下新建一个GameObject&a…

Jmail的主要参数列表

说明&#xff1a;更多的信息请参考Jmail说明&#xff0c;我想这已经足够用的了。 &#xff08;1&#xff09;Body&#xff08;信件正文&#xff09; : 字符串如&#xff1a;JMail.Body "这里可以是用户填写的表单内容&#xff0c;可以取自From。" &#xff08;2&…

VMware VSphere 虚拟化云计算学习配置笔记(一)

第一章&#xff1a;VMware和VSphere 简单介绍 在VMware发布的vSphere 5.0中&#xff0c;VMware淘汰了ESX&#xff0c;ESXi成为了唯一的hypervisor。在ESXi 5.0中&#xff0c;VMware提供了七大重要的增强功能&#xff0c;包括&#xff1a;镜像生成器&#xff08;Image Builder&a…

“国产操作系统最大难题在于解决「生产关系」” | 人物志

作者 | 高卫华来源 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09;操作系统是所有软件体系的基础&#xff0c;而随着中国物联网产业的迅猛发展&#xff0c;诸多国产嵌入式操作系统开始跃出水面。其中之一包括 SylixOS&#xff0c;这是一款由国内企业翼辉信息自主设计开…

详解 Vue Vuex 实践

2019独角兽企业重金招聘Python工程师标准>>> 随着应用复杂度的增加&#xff0c;我们需要考虑如何进行应用的状态管理&#xff0c;将业务逻辑与界面交互相剥离&#xff0c;详细讨论参考笔者的2016-我的前端之路:工具化与工程化。Vue 为我们提供了方便的组件内状态管理…

可控制的页面内滚动区域

效果预览 下面我们就来详细讲解一下这种效果的制作方法&#xff1a; 首先&#xff0c;我们在样式表里加入“.opacity {FILTER: alpha(opacity100)”&#xff0c;看下面&#xff01; <style type"text/css"><!--.opacity {FILTER: alpha(opacity100)}-->&…

提升对ASP.NET网站性能和多并发的设计的讨论

对于如何提高应用程序的性能&#xff08;无论是互联网应用还是企业级应用&#xff09;我的观点一直是考虑一个核心&#xff1a;IO处理。因为我认为目前的CPU的处理能力已经是非常高了&#xff0c;正常编写的在内存中处理的代码没有太严重的问题都不会对CPU造成很大的影响&#…