首页  

一致性算法raft简介     所属分类 raft 浏览量 1384
The Raft Consensus Algorithm

What is Raft?
Raft is a consensus algorithm that is designed to be easy to understand. 
It's equivalent to Paxos in fault-tolerance and performance. 
The difference is that it's decomposed into relatively independent subproblems, 
and it cleanly addresses all major pieces needed for practical systems. 
We hope Raft will make consensus available to a wider audience, 
and that this wider audience will be able to develop a variety of higher quality consensus-based systems than are available today.

Raft是一种易于理解的一致性算法
在容错和性能方面,与Paxos相当 ,
不同之处在于,它被分解为相对独立的子问题,并且清晰地处理了实际系统所需的所有主要部分。

希望Raft能够让更广泛的受众达成共识,开发出更加高质量的基于共识的系统。




Hold on—what is consensus?

Consensus is a fundamental problem in fault-tolerant distributed systems. 
Consensus involves multiple servers agreeing on values. 
Once they reach a decision on a value, that decision is final. 
Typical consensus algorithms make progress when any majority of their servers is available; 
for example, a cluster of 5 servers can continue to operate even if 2 servers fail. 
If more servers fail, they stop making progress (but will never return an incorrect result).

在容错分布式系统中,一致性是一个基本问题。共识涉及多个服务器就值达成一致。一旦他们对一个值做出决定,这个决定就是最终的。
当大多数服务器可用时,典型的一致算法就能正常工作
5台服务器组成的集群即使有2台服务器失败,也可以继续运行。如果更多的服务器失败,它们将停止运行(但永远不会返回错误的结果)。



Consensus typically arises in the context of replicated state machines, 
a general approach to building fault-tolerant systems. 
Each server has a state machine and a log. 
The state machine is the component that we want to make fault-tolerant, such as a hash table. 
It will appear to clients that they are interacting with a single, reliable state machine, 
even if a minority of the servers in the cluster fail. 
Each state machine takes as input commands from its log. 
In our hash table example, the log would include commands like set x to 3.
A consensus algorithm is used to agree on the commands in the servers' logs. 
The consensus algorithm must ensure that if any state machine applies set x to 3 as the nth command, 
no other state machine will ever apply a different nth command. 
As a result, each state machine processes the same series of commands 
and thus produces the same series of results and arrives at the same series of states.
 
共识通常出现在状态机复制上下文中,这是一种构建容错系统的通用方法。

每个服务器都有一个状态机和一个日志。状态机是实现容错的组件,比如散列表。
在客户机看来,它们与一个可靠的状态机交互,即使集群中的少数服务器出现故障。
每个状态机从其日志中获取输入命令。在哈希表示例中,日志将包含像set x to 3这样的命令。
一致算法用于对服务器日志中的命令达成一致。
共识算法必须确保,如果任何状态机将set x to 3应用为第n条命令,那么其他状态机将不会应用不同的第n条命令。
因此,每个状态机处理相同的命令序列,从而产生相同的结果序列,并到达相同的状态序列。

上一篇     下一篇
javap查看字节码

leveldb简介

leveldb要点

aerospike网络及常用端口

如何做一个小公司的技术总监

LPR要点整理