分布式一致性算法Raft论文(2)——复制状态机_状态机复制能处理什么问题-程序员宅基地

技术标签: # Raft  Raft  

2 Replicated state machines

集群中某些服务器不可用,整个集群还可以工作。

算法保证安全性;

复制日志保持顺序性;

        Consensus algorithms typically arise in the context of replicated state machines [37]. In this approach, state machines on a collection of servers compute identical copies of the same state and can continue operating even if some of the servers are down. Replicated state machines are used to solve a variety of fault tolerance problems in distributed systems. For example, large-scale systems that have a single cluster leader, such as GFS [8], HDFS [38],and RAMCloud [33], typically use a separate replicated state machine to manage leader election and store configuration information that must survive leader crashes. Examples of replicated state machines include Chubby [2] and ZooKeeper [11].

        共识算法通常出现在复制状态机的上下文中[37]。在这种方法中,服务器集合上的状态机计算相同状态的相同副本,即使某些服务器关闭,整个集群也可以继续运行。复制状态机用于解决分布式系统中的各种容错问题。例如,具有单个集群领导者的大型系统,如GFS[8]、HDFS[38]和RAMCloud[33],通常使用单独的复制状态机来管理领导者选举并存储必须在领导者崩溃后生存的配置信息。复制状态机的示例包括Chubby[2]和ZooKeeper[11]。

        Replicated state machines are typically implemented using a replicated log, as shown in Figure 1. Each server stores a log containing a series of commands, which its state machine executes in order. Each log contains the same commands in the same order, so each state machine processes the same sequence of commands. Since the state machines are deterministic, each computes the same state and the same sequence of outputs.

        复制状态机通常使用复制log实现,如图1示。每个服务器存储一个包含一系列命令的日志,其状态机按顺序执行这些命令。每个日志以相同的顺序包含相同的命令,因此每个状态机处理相同的命令序列。由于状态机是确定性的,因此每个状态机计算相同的状态和相同的输出序列。

Figure 1: Replicated state machine architecture. The consensus algorithm manages a replicated log containing state machine commands from clients. The state machines process identical sequences of commands from the logs, so they produce the same outputs.

图1 :复制状态机架构。一致性算法管理包含来自client的状态机命令的复制日志。状态机处理来自日志的相同命令序列,因此它们产生相同的输出。

        Keeping the replicated log consistent is the job of the consensus algorithm. The consensus module on a server receives commands from clients and adds them to its log. It communicates with the consensus modules on other servers to ensure that every log eventually contains the same requests in the same order, even if some servers fail. Once commands are properly replicated, each server’s state machine processes them in log order, and the outputs are returned to clients. As a result, the servers appear to form a single, highly reliable state machine.

        保持replicate log的一致性是一致性算法的工作。服务器上的一致性模块从客户端接收命令并将其添加到日志中。它与其他服务器上的一致性模块通信,以确保每个日志最终以相同的顺序包含相同的请求,即使某些服务器出现故障。一旦命令被正确复制,每个服务器的状态机将按日志顺序处理它们,并将输出返回给客户端。因此,服务器似乎形成了一个单一的、高度可靠的状态机

Consensus algorithms for practical systems typically have the following properties:

实际系统的一致性算法通常具有以下特性:

  • They ensure safety (never returning an incorrect result) under all non-Byzantine conditions, including network delays, partitions, and packet loss, duplication, and reordering.
  • 安全性:它们确保在所有非拜占庭条件下的安全性(从不返回错误结果),包括网络延迟、分区、数据包丢失、复制和重新排序。
  • They are fully functional (available) as long as any majority of the servers are operational and can communicate with each other and with clients. Thus, a typical cluster of five servers can tolerate the failure of any two servers. Servers are assumed to fail by stopping; they may later recover from state on stable storage and rejoin the cluster.
  • 大多数:只要大多数服务器都可以运行,并且可以相互通信和与客户机通信,它们就可以完全正常工作(可用)。因此,由五台服务器组成的典型集群可以容忍任何两台服务器的故障。假定服务器因停止而发生故障;它们可能稍后从稳定存储上的状态恢复并重新加入集群。
  • They do not depend on timing to ensure the consis-tency of the logs: faulty clocks and extreme message delays can, at worst, cause availability problems.
  • 它们不依赖于时间来确保日志的一致性:错误的时钟和极端的消息延迟在最坏的情况下会导致可用性问题。
  • In the common case, a command can complete as soon as a majority of the cluster has responded to a single round of remote procedure calls; a minority of slow servers need not impact overall system performance.
  • 在一般情况下,只要集群的大多数成员成功响应了一轮远程过程调用,命令就可以完成;少数速度较慢的服务器不需要影响总体系统性能。

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Gloria_y/article/details/121597411

智能推荐

【java开发者工具】IDEA(java编程语言开发的集成环境)带你了解背后故事与基础操作指南_idea支持java框架和库的开发吗-程序员宅基地

文章浏览阅读4.7k次,点赞149次,收藏139次。​IDEA 全称 IntelliJ IDEA,是java编程语言的集成开发环境。IntelliJ在业界被公认为最好的Java开发工具,尤其在智能代码助手、代码自动提示、重构、JavaEE支持、各类版本工具(git、svn等)、JUnit、CVS整合、代码分析、 创新的GUI设计等方面的功能可以说是超常的。IDEA是JetBrains公司的产品,这家公司总部位于捷克共和国的首都布拉格,开发人员以严谨著称的东欧程序员为主。它的旗舰版还支持HTML,CSS,PHP,MySQL,Python等。_idea支持java框架和库的开发吗

Python代码复现Active Learning for Parzen Window Classifier_activelearning库python-程序员宅基地

文章浏览阅读196次。[1] O. Chapelle, "Active Learning for Parzen Window Classifier", Proceedings of the Tenth International Workshop Artificial Intelligence and Statistics, 2005._activelearning库python

CSP202006-1-程序员宅基地

文章浏览阅读68次。试题名称:线性分类器时间限制:1.0s内存限制:512.0MB问题描述: C++#include<iostream>using namespace std;class Point{ public: int x; int y; char type;};int main(){ int n, m; cin >> n >> m; Point typeA[1005

有向无环图(DAG)_json描述有相无环图-程序员宅基地

文章浏览阅读258次。2019-08-27_json描述有相无环图

element ui 或者 element-admin 模板 img 标签 图片不能正常显示或者资源不能正常加载问题_elment-admin 外部链接图片打不开-程序员宅基地

文章浏览阅读2.1k次。引用项目内部的图片或者资源,总是显示不正常或者正常加载,解决办法:用 require()包裹起来,如图:<el-image style="width: 100px; height: 100px" :src="courseInfo.cover" :fit="cover"></el-image>courseInfo:{cover: require('@/assets/default.jpg')}或者直接:<el-image style="width: _elment-admin 外部链接图片打不开

面试必备1:HashMap(JDK1.8)原理以及源码分析_1.8数组增删原理-程序员宅基地

文章浏览阅读5.4k次,点赞10次,收藏10次。HashMap概述:1:HashMap的数据结构在分析HashMap的源码前,我们需要先知道HashMap是基于什么样的数据结构来进行数据存储的,知道了这些我们再去看源码就容易的多。散列表(哈希表) 我们常用的数据结构就是数组和链表,数组具有增删慢查找快的特点,而链表具有增删快查找慢 的特点;基于上述特点,HashMap 即想要查询效率快,又想增删效率高,基于这样的特点HashMap的数据结..._1.8数组增删原理

随便推点

C#/.NET 多线程任务Task的详解——应用实例_.net task-程序员宅基地

文章浏览阅读9.9k次,点赞2次,收藏32次。Task类介绍:Task 类的表示单个操作不返回一个值,通常以异步方式执行。 Task 对象是一个的中心思想 基于任务的异步模式 首次引入.NET Framework 4 中。 因为由执行工作 Task 对象通常以异步方式执行在线程池线程上而不是以同步方式在主应用程序线程,可以使用 Status 属性,以及 IsCanceled, ,IsCompleted, ,和 IsFaulted 属性,以确..._.net task

css响应式网页设计:自适应屏幕宽度、移动页面开发技巧_响应式 自适应大小 css-程序员宅基地

文章浏览阅读1.4w次,点赞7次,收藏56次。html响应式网页设计:自动适应屏幕宽度背景移动设备正超过桌面设备,成为访问互联网的最常见终端。于是,网页设计师不得不面对一个难题:如何才能在不同大小的设备上呈现同样的网页?手机的屏幕比较小,宽度通常在600像素以下;PC的屏幕宽度,一般都在1000像素以上(目前主流宽度是1366×768),有的还达到了2000像素。同样的内容,要在大小迥异的屏幕上,都呈现出满意的效果,并不是一件容易的事。..._响应式 自适应大小 css

Pandas基础操作2——DataFrame的基础操作_data=nr-程序员宅基地

文章浏览阅读257次。紧接着上一篇博客,创建了Series跟DataFrame今天学习DataFrame的行列添加和删除操作,以及append和切片操作下面看代码:import numpy as npimport pandas as pdfrom pandas import Series, DataFrame# Seriess = Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd'])print(s)# >>># a 1# b _data=nr

mysql 高可用架构 mha 之四 Error happened on checking configurations_mastermonitor.pm, ln427] error happened on checkin-程序员宅基地

文章浏览阅读3.9k次。os: ubuntu 16.04db: mysql 5.7.25mha: 0.58使用 masterha_check_repl 时一直报错Fri Mar 8 11:31:30 2019 - [error][/usr/share/perl5/MHA/MasterMonitor.pm, ln427] Error happened on checking configurations. Red..._mastermonitor.pm, ln427] error happened on checking configurations

【HarmonyOS】webview在鸿蒙系统无点击反应_华为鸿蒙切换不了webview-程序员宅基地

文章浏览阅读1.5k次。webview的activity的launchmode是singleTop类型的。在shouldOverrideUrlLoading方法中,判断url是否包含某个字段,然后替换url该字段为其他字段,然后继续打开当前activity,但是跳转不过去。设置WebViewClient 且该方法返回 true ,则说明由应用的代码处理该 url,WebView 不处理。1、在其他品牌手机没有出现这个问题,华为非鸿蒙系统也无此问题。欲了解更多更全技术文章,欢迎访问。_华为鸿蒙切换不了webview

form表单提交到servlet_利用发布的form表单发送请求到servlet,返回给浏览器信息:密码不争取(返回信息-程序员宅基地

文章浏览阅读1w次,点赞6次,收藏15次。form表单提交到servlet时遇到无法跳转到指定的servlet_利用发布的form表单发送请求到servlet,返回给浏览器信息:密码不争取(返回信息