Skip to content
/ raft Public

Raft consensus algorithm implementation.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt
Notifications You must be signed in to change notification settings

styvane/raft

Repository files navigation

raft

This is another attempt implementing the Raft consensus algorithm.

It's not indented to be used in production.

I did not implement the following ideas in the paper:

  • Persistency(all states are volatiles).
  • Cluster membership changes
  • Log compaction

TODO

  • Leader discovery and confirmation
  • Append only write operation entry
  • Persist log and non-volatiles states.
  • Graceful shutdown

Installation

cargo install --bins --path kvserver

Run

To run this, we need a configuration see example.

We will then start the following processes. The number of processes depends on the configuration.

kvserver --config config.yaml --node-id 0 --port 21000
kvserver --config config.yaml --node-id 1 --port 22000
kvserver --config config.yaml --node-id 2 --port 23000
kvserver --config config.yaml --node-id 3 --port 24000
kvserver --config config.yaml --node-id 4 --port 25000

Using the client to connect to the leader, then Set/Get/Delete values. I did not implement leader discovery, so you will need to watch the log to identifier the leader.

kvserver-client --port 23000 

About

Raft consensus algorithm implementation.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.txt
MIT
LICENSE-MIT.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages