Skip to content

mggger/raft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

关于

raft算法中文翻译

zatt raft的python实现

学习raft算法, 借鉴zatt, 一步一步实现raft

实现分为4部分:

  1. 选举, 服务之间的通信, 各种身份切换的逻辑, 实现对应分支(dev1)

  2. 集群成员变化,配置更新, 实现对应分支(dev2)

  3. 日志压缩, 实现对应分支(dev3)

  4. 分布式kv(master)

进度

quick start

启动服务

id=5254 python3 main.py
id=5255 python3 main.py
id=5256 python3 main.py 

当前目录运行python3

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from client import DistributeDict
>>> d = DistributeDict("127.0.0.1", 5254)
>>> d1 = DistributeDict("127.0.0.1", 5255)
>>> d['test'] = 'yes'
>>> d1['test']
'yes'
>>> 

About

raft的python实现

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages