Giter Site home page Giter Site logo

raft's Introduction

关于

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'
>>> 

raft's People

Contributors

mggger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wwww6662003

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.