Skip to content

straightdave/raft

Repository files navigation

Raft

Coding exercise trying to implement Raft consistency algorithm.

Learning materials

The Demo on the page is critical for me to understand the Raft.

2 - Paper

More detailed information.

Exercise applications

├── cmd
│   ├── client
│   │   └── main.go
│   └── server
│       └── main.go

Server

one server:

$ ./server -raft.peers 192.168.1.76:8766
2020/04/29 09:51:24 Starts with 1 peer(s): [192.168.1.76:8766]
2020/04/29 09:51:24 Serving TCP connections at :8765
2020/04/29 09:51:24 192.168.1.76:8765 becomes FOLLOWER
2020/04/29 09:51:24 192.168.1.76:8765 becomes CANDIDATE {term=1}
...

another server:

$ ./server -raft.port 8766 -raft.peers 192.168.1.76:8765
2020/04/29 09:51:24 Starts with 1 peer(s): [192.168.1.76:8765]
2020/04/29 09:51:24 Serving TCP connections at :8766
2020/04/29 09:51:24 192.168.1.76:8765 becomes FOLLOWER
2020/04/29 09:51:24 192.168.1.76:8765 becomes CANDIDATE {term=1}
...

Client

$ ./client
127.0.0.1:8765 0> set a 1
OK
127.0.0.1:8765 1> get a
1
127.0.0.1:8765 2>

About

Raft exercise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages