Coding exercise trying to implement Raft consistency algorithm.
The Demo on the page is critical for me to understand the Raft.
2 - Paper
More detailed information.
├── cmd
│ ├── client
│ │ └── main.go
│ └── server
│ └── main.go
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
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>