Raft論文閱讀筆記
- Raft叢集中,每個server只有三種狀態:leader,follower,candidate(選舉)。
- follower不會主動傳送訊息,只會接受和響應訊息。
- leader處理所有的客戶端請求,如果follower接收到客戶端的請求,則轉發給leader。
- candidate是選舉狀態。
Raft主要是有三點:
- Leader Election: raft叢集裡是主從的,leader來進行所有操作,follower不會主動向叢集內的其他節點發起請求。
- Log Replication: leader處理來自客戶端的請求,leader把自己的日誌發向follower做複製
- Safety: 只有含有最新的日誌的節點可以成為leader,如果收到投票請求時,發現對方的日誌沒有自己的新,那麼久投否決票。
其實總體看下來,Raft理論上的確不難,不過呢,還是要自己造一個輪子才知道真正的難度。
- ofollow,noindex" target="_blank">https://www.usenix.org/conference/atc14/technical-sessions/presentation/ongaro
- https://raft.github.io/raft.pdf
- https://raft.github.io/