Case Study – Chubby

擷取自網路

What is Chubby …

1.
高度可用的協調服務。
High available coordination service.

2.
是一種鎖,目的是為了保持系統一致性。
It is a lock service, in order to achieve consistency among distributed system.

Desired properties of Chubby …

1.高度可用。 High availability.

2.可靠性。 Reliability.

3.易於理解。(這也是為什麼是鎖服務的原因) Easy to understand. (This is why Chubby is lock service)

Components of Chubby …

1.
通常五個服務組成一個 Chubby Cell.。
Usually, there are five servers of a Chubby Cell.

2.
利用 Paxos 達成內部一致。
Using Paxos to achieve consensus in Chubby Cell.

3.
利用 Paxos 選出內部的 ChunkMaster。
Using Paxos to choose the ChunkMaster.

4.
ChunkMaster 是對外的管道。
ChunkMaster is an entrance for outside system.

Process …

1.
客戶端發送請求給最近的節點。
Client sends request to nearest node.

2.
若節點不是 ChunkMaster ,則回傳 ChunkMaster 的位置。
If the node isn’t ChunkMaster, it returns ChunkMaster’s address.

3.
客戶端直接傳送請求給 ChunkMaster。
Client directly sends request to ChunkMaster.

4.
利用廣播將變化的值(寫動作)告訴其他的節點,達成共識。
Propagated changed values (write) to other nodes, in order to achieve consensus.

5.
如果是讀動作,則不需要達成共識。
If reads, it can handle without consensus.

In term of Client …

1.
客戶端利用 Library 像 ChunkMaster 發出新的 Session 請求。
Client sends request to ChunkMaster a new session request by Chubby library.

2.
每個 session 有一定的時間,若想要延長時間,則須重新更新 Session。
There is a lease of every session. If client needs more time, it must renew session before lease expires.

Questions …

1. Why does it have different version between nodes?
因為 Paxos 中,Accept 跟 Learn 之間需要時間。
There is a gap between Accept Phase and Learn Phase.

2.How to scale Chubby?
a.客戶端可以暫存讀取的資料。 Client can cache the data it read.
b. 利用代理。 Using Proxy.

3.How does client know the data is not valid anymore?
Master 會傳送無效訊息給客戶。
Master will send invalidation to client.

4.How to handle ChunkMaster failed?
利用 Paxos 選出新的 Master。
Using Paxos to choose new Master.

5.How to choose master?
其中一個節點提出成為新 master 的請求,其他節點需要同意。
One of nodes promote itself as master and other nodes need to agree.

-MsHe

發表留言