jakubdyszkiewicz / raft

Simplified implementation of the Raft Consensus Algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raft

This is simplified implementation of the Raft Consensus Algorithm. There is no log replication yet, current implementation can be used to do leader election.

The implementation supports the contract described there. It is recommended to run dashboard for watching changes.

Dashboard

Build

go build ./...

Test

go test ./...

Run

The first argument is an address that node will bind to. The rest of the arguments are peers. To run 3 nodes that connect with each other:

go cmd/main.go localhost:9001 localhost:9002 localhost:9003
go cmd/main.go localhost:9002 localhost:9001 localhost:9003
go cmd/main.go localhost:9003 localhost:9001 localhost:9002

Known issues

There are race conditions. All requests and events from timer should be processed on one queue to avoid concurrent modifications.

About

Simplified implementation of the Raft Consensus Algorithm


Languages

Language:Go 100.0%