Skip to content

palashc/goPaxos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goPaxos

goPaxos is an implementation of a single instance of the Paxos consensus algorithm in Go. It is based on the outline given in Paxos Made Simple. The main components of the algorithm - proposers, acceptors and learners - are implemented in their respective packages.

Usage

  1. Run make in the src/paxos directory.
> make
go install ./...
  1. Add bin/ from the repository to your PATH.
  2. Create a configuration file with the host:port information for proposers, acceptors and learners.
> init-config -np 2 -na 3 -nl 2
{
  "Proposers": [
    "localhost:34379",
    "localhost:34380"
  ],
  "Acceptors": [
    "localhost:34381",
    "localhost:34382",
    "localhost:34383"
  ],
  "Learners": [
    "localhost:34384",
    "localhost:34385"
  ]
}
  1. Start proposer, acceptors, learners.
> init-proposer &
> init-acceptor &
> init-learner &

Tests

  1. Simple: This is the normal case. A proposer proposes a value. All learners should get that value eventually.
> simple
PASS.
  1. Concur: Two proposers propose a value concurrently. All learners should get the same value eventually.
> concur
PASS with hello_world2

TODO

  • Distinguished Proposer - Use zookeeper for leader election.
  • Multi-Paxos - Support for multiple instances of the algorithm to build a replicated state machine.
  • Fault Tolerance - Test single/multi paxos with random failures.

About

Implementing Paxos in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published