Presentation is loading. Please wait.

Presentation is loading. Please wait.

GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based.

Similar presentations


Presentation on theme: "GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based."— Presentation transcript:

1 GFS

2 Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based on the best performance per dollar r Uses customized versions of Linux

3 Google r Servers are put into racks and connected through a 1 GB Ethernet r Racks are organized into clusters connected and connected to a gigabit cluster switch r A data center consists of clusters r Clusters run an application/service

4 Google r Google has numerous data centers scattered around the world (2012) m 11 are found in the United States + 3 being built m 1 in Canada m 17 international (outside of US and Canada) r No one is sure of how many and where

5 Motivation r Google needs a good distributed file system m Redundant storage of massive amounts of data on cheap and unreliable computers r Why not use an existing file system? m Google’s problems are different from anyone else’s Different workload and design priorities m GFS is designed for Google apps and workloads m Google apps are designed for GFS

6 Google Workload Characteristics r Most files are mutated by appending new data – large sequential writes r Random writes are very uncommon r Files are written once, then they are only read r Reads are sequential r Large streaming reads and small random reads r High sustained throughput favoured over low latency

7 Google Workload Characteristics r Google applications: m Data analysis programs that scan through data repositories m Data streaming applications m Archiving m Applications producing (intermediate) search results

8 Assumptions r High component failure rates m Inexpensive commodity components fail all the time r “Modest” number of HUGE files m Just a few million m Each is 100MB or larger; multi-GB files typical

9 GFS Architecture r Single master for a cluster r Multiple chunkservers

10 Chunks r Files are divided into fixed-size chunks of 64 MB r Each chunk has an identifier, chunk handle, assigned by the master at the time of chunk creation m Consists of file name, chunk number r Each chunk is replicated 3 times

11 GFS Architecture

12 Chunkservers r Store chunks on local disks as Linux files r Read/write chunk data specified by a chunk handle and byte range

13 GFS Architecture

14 Master r Stores metadata m The file and chunk namespaces m Mapping from files to chunks m Locations of each chunk’s replicas (referred to as chunk locations) r Interacts with clients r Creates chunk replicas

15 Master r Orchestrates chunk modifications across multiple replicas r Deletes old files (via garbage collection)

16 Read r The client application translates the file name and byte offset specified application into a chunk index within the file r The master replies with the corresponding chunk handle (information needed to find a chunk) and locations of the replicas.

17 Read r The client then sends a request to one of the replicas -- most likely the closest one r Note: Further reads of the same chunk require no more client-master interaction

18 Updates of Replicated Data r Each mutation (modification) is performed at all the replicas r Modifications are applied in the same order across all replicas r If you have three chunks do you want one chunk to have a b c and other to have a c b ? r For each chunk there is a primary chunk that coordinates updates

19 Updates of Replicated Data r After finding replicas the client pushes data to the replicas r The replicas do not write r The primary tells the replicas in which order they should apply modifications r For each update the primary assigns a sequence number r Replicas update chunks based on the sequence number

20 Updates of Replicated Data r Let us say there are two updates to be processed by a chunk from two clients: w a and w b r Their requests are received by the replicas r Different replicas may receive requests in different orders

21 Updates of Replicated Data r Replicas should apply the writes in the same order r The primary replica assigns a sequence number to each write r w b may get sequence number 1 r w a may get sequence number 2 r The sequence numbers are sent to each replica

22 Updates of Replicated Data r Let’s say that a replica got w a but not w b r It receives a sequence number of 2 for w a and the sequence number of 1 for w b r It delays executing w a until it receives w b

23 Updates of Replicated Data 1. Client asks master for replica locations 2. Master responds 3. Client pushes data to all replicas; replicas store it in a buffer cache 4. Client sends a write request to the primary (identifying the data that had been pushed) 5. Primary forwards request to the secondaries (identifies the order) 6. The secondaries respond to the primary 7. The primary responds to the client

24 Failure Handling During Updates r If a write fails at the primary: m The primary may report failure to the client – the client will retry m If the primary does not respond, the client retries from Step 1 by contacting the master r If a write succeeds at the primary, but fails at several replicas m The client retries several times (Step 3-7)

25 Metadata On Master r File names and chunk mappings are also kept persistent in an operation log r Chunk locations are kept in memory only m It will be lost during the crash m The master asks chunk servers about their chunks at startup – builds a table of chunk locations

26 Why Keep Metadata In Memory? r To keep master operations fast r Master can periodically scan its internal state in the background, in order to implement: m Re-replication (in case of chunk server failures) m Chunk migration (for load balancing)

27 Why Not Keep Chunk Locations Persistent? r Chunk location – which chunk server has a replica of a given chunk r Master polls chunk servers for that information on startup r Thereafter, master keeps itself up-to- date: m It controls all initial chunk placement, migration and re-replication m It monitors chunkserver status with regular HeartBeat messages

28 Why Not Keep Chunk Locations Persistent? r Motivation: simplicity r Eliminates the need to keep master and chunkservers synchronized r Synchronization would be needed when chunkservers: m Join and leave the cluster m Change names m Fail and restart

29 Operation Log r Historical record of metadata changes r Maintains logical order of concurrent operations r Log is used for recovery – the master replays it in the event of failures r Master periodically checkpoints the log

30 Chunk Size r Chunk size is 64 MB m Larger than typical file system block sizes r Advantages m Reduces a client’s need to interact with the master m Reduce network overhead by keeping a persistent TCP connection to the chunkserver over a period of time m Reduces the size of the metadata stored on the master

31 Chunk Size r Disadvantages m A small file consists of a small number of chunks m The chunkservers storing these chunks may become hot spots if many clients are accessing the same file Does not occur very much in practice

32 Deployment in Google r Many GFS clusters r Hundreds/thousands of storage nodes each r Managing petabytes of data

33 Summary r GFS demonstrates how to support large- scale processing workloads on commodity hardware m design to tolerate frequent component failures m optimize for huge files that are mostly appended and read m feel free to relax and extend FS interface as required m go for simple solutions (e.g., single master) r GFS has met Google’s storage needs


Download ppt "GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based."

Similar presentations


Ads by Google