Skip to content

ludanik/raft

Repository files navigation

Raft

My implementation of the Raft distributed consensus protocol in Go, as described by the Raft paper. This implementation supports all features described in the paper, except for snapshotting and cluster membership changes.

Getting Started

  1. Clone the Git repository, build Raft
git clone https://github.com/ludanik/raft.git
cd raft
make build
  1. Start a Raft cluster. Open three terminal windows and run the Raft node on each.
# Terminal window 1:
./bin/raft --cluster="1:3001,2:3002,3:3003" --node=1
# Terminal window 2:
./bin/raft --cluster="1:3001,2:3002,3:3003" --node=2
# Terminal window 3:
./bin/raft --cluster="1:3001,2:3002,3:3003" --node=3

Kubernetes Deployment

  1. Build the container and deploy it to a running Kubernetes cluster. You will need to write a deployment.yaml for your cluster.
docker build -t github.com/ludanik/raft .
kubectl apply -f deployment.yaml
  1. Get the pod name and view its output
kubectl get pods
kubectl logs -f POD_NAME

Misc

To regenerate Protobuf files

protoc --go_out=. --go-grpc_out=. raft.proto

About

Raft implementation in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors