Skip to content

Simple (incomplete) implementation of Raft consensus

Notifications You must be signed in to change notification settings

kalexmills/elect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elect

Implementation of Raft consensus

The ultimate goal is to produce an implementation that works, has been tested, and provides me with experience with Raft, Go, and testing distributed systems.

** WORK-IN-PROGRESS **

  • Leader election seems to be working as expected under some crash scenarios, but has not yet been thoroughly tested.

Instructions

Install the CLI

go install github.com/kalexmills/elect

Run a local demo

elect launch cluster 1234 2345 3456

The above command launches three subprocesses, each listening on ports 1234 2345 3456, respectively. The processes immediately begin running the Raft protocol, logging to STDOUT. Killing the main process will cleanup the subprocesses.

Run a single node

elect launch node 1234 localhost:2345 localhost:3456

The above command launches a single subprocess listening on port 1234, and looking for peers running at localhost:2345 and localhost:3456, respectively. You can use this version of the command for deployment to a test environment.