Skip to content

taekop/byraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Byraft

Byraft is an implementation of Raft consensus algorithm in Ruby using gRPC.

Install

gem install grpc

Usage

script/byraft # run server
script/client # request as client

Spec

raft.proto

Example

Configuration

  • election timeout : between 1 and 2 sec
  • heartbeat period : 0.1 sec
  • Write committed commands in log/log-node-<id>.txt
  • Nodes
    • #1 on localhost:50051
    • #2 on localhost:50052
    • ...

Options

  • -n <number of nodes> : default is 3
  • -c <command> : request command as client
  • -v : set logger level to DEBUG, otherwise INFO

Run servers in different terminals.

script/example 1 -n 5 # terminal 1
script/example 2 -n 5 # terminal 2
script/example 3 -n 5 # terminal 3
script/example 4 -n 5 # terminal 4
script/example 5 -n 5 # terminal 5

Run client to append log.

script/example 1 -c 'RUN COMMAND' # another terminal

Test

bundle install
bundle exec rspec

TODO

Reference

paper

About

Raft Implementation in Ruby

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published