200 likes | 494 Vues
The Google File System. and Map Reduce. The Team. Pat Crane Tyler Flaherty Paul Gibler Aaron Holroyd Katy Levinson Rob Martin Pat McAnneny Konstantin Naryshkin Elliot Pennington Chris Scalabrini. System Expectations. System failures are the norm
E N D
The Google File System and Map Reduce
The Team • Pat Crane • Tyler Flaherty • Paul Gibler • Aaron Holroyd • Katy Levinson • Rob Martin • Pat McAnneny • Konstantin Naryshkin • Elliot Pennington • Chris Scalabrini
System Expectations • System failures are the norm • System will store some large (multi-gigabyte) files • Expected Reads • Large Streaming (over 1MB) • Small Random (a few KB out of someplace random) • Expected Writes • Long Appending Writes • Multiple Users Appending at Once • Middle of File Seldom Modified • High Bandwidth > Low Latency
The Basic Layout • One Master Server • A bunch of Chunk Servers • Clients
"Chunks" • Chunks are pieces of data • Identified by "chunk handle" • Replicated across multiple Chunkservers to prevent loss • If number is low Master will reallocate more replicas • Reallocation prioritized • 64MB • Why so big? • Leaves the Master alone for longer • Less metadata on the master because there are less chunks • Drawbacks • Many clients might want same chunk • Doesn't happen much • Store as plain Linux files
One master server to rule them all • Makes it simple • Big precautions needed to prevent Master from being a bottleneck • Maintains all system Metadata • File and Chunk namespaces • Access control information • Mapping from files to Chunks • Locations for the replicas of every Chunk • Also controls • Chunk lease management • Garbage collection • HeartBeat The Master Server
The Chunkserver • Commodity computers running Linux • Failures expected • Holds Chunks
The Client • Responsibilities • Interact with Master to find where to read/write • Interact with Chunkservers to read/write • Requests several chunks at once to reduce load on Master • All data-bearing messages go directly to and from chunkservers • The client does not cache data it reads or writes (nor does the chunkserver) • Files being read are too big for it to be useful • Now no worries about cache coherence
All Metadata is kept in memory of the Master • A log is kept of all changes, kept on Master disk and replicated on remote systems • Master does not store persistent chunk data • Queries all chunk servers at startup to build its Metadata table • Queries new Chunkservers as they join the cluster • Master keeps itself up to date, since it controls all chunk placement • Also periodically scans background (HeartBeat) • Garbage Collection • Re-replication (chunkserver failure) • Chunk Migration Metadata Storage and Updates
Operation Log • Only persistent record of Metadata • Time line to define order of concurrent operations • Everything uniquely identified in this log • Replicated across many Chunkservers • No changes visible to client until new changes replicated • Batches several files together before flushing • Master uses the log file to recover its file system on startup
Log Checkpoints • Taken when log grows to a certain size • System recovers by playing newest records • Written in tree form to easily read back into memory • Take a long time to do • Made to not interfere with incoming requests • Done in a separate thread • When completed, written both locally and remotely
Leases and Mutations • Client asks master which Chunkserver holds the lease on the chunk (chooses one if no lease) • Master tells Clients • which Chunkserver to contact • locations of replicas and secondary replicas • C3lient caches this • After all the replicas acknowledge data sent write request to primary • Primary forwards all data to secondary replicas • Secondaries write • Primary replies to client and reports errors
Fully utilize each machine's bandwidth Data pushed linearly along chain Full outbound bandwidth used to transfer data as fast as possible Avoid network bottlenecks Foward data to "closest" machine "Distances" can be accurately estimated from IP addresses Minimize Latency to push through all the data Pipeline data transfer over TCP connections Once a chunkserver receives some data, it starts forwarding immediately. Data Flow
Snapshots • Copy of file or directory tree • Process • Revoke outstanding leases • Logs operation to disk • Makes a copy • On the same Chunkserver • Has everybody refer to that • Nobody can tell the difference!
Namespace Management and Locking • Many operations take a long time • Don't want to make everybody wait • Locking specific areas of namespace • Read lock on directory - prevents deleting, renaming, and snapshotting • Write lock on file name - prevents the same file from being written to twice at the same time • Permits concurrent edits to same directory
Garbage Collection (1/2) • Garbage collection used rather than immediate deletion • Advantages • Simple, Reliable,Chunkcreation, Uniform • Note that files are rarely deleted • Space is NOT reused right away! • Steps to perform "Garbage Collection" • System logs deletion • File is hidden and name is changed • File has its time stamp set - this is used for removal • During regular scan deletes file if timestamp minus current time is older than a specified interval • Interval time is configurable • 3 days is cited in paper
Garbage Collection (2/2) • Also deletes "orphaned chunks" in scans • An "orphaned chunk" is a chunk that is not reachable from any file • Metadata for this "orphaned chunk" is removed as well • When a HeartBeat message is sent from master to chunkservers... • Each chunkserver reports a subset of the chunks it has • Master tells the chunkserver the identity of all chunks in the subset that is contains no metadata for. • Chunkserver garbage collects those files. • Stale Replica Detection • Each chunk contains a"chunk version number" (CVN) • Master tells each chunkserver the up-to-date CVN • If the CVN is out of date, chunkserver updates chunk
Fault Tolerance and Diagnostics • Fast recovery with logfiles and checkpoints • GFS can easily detect out-of-date or bad chunks, and then fix them • Chunk replication • Master coordinates data movement • If Master fails • Outside system tells it to make a new Master • Shadow • Provide read-only in event of total failure • Updates itself just like a normal master • Chunks have checksums • Diagnostics done mostly with logs
Questions? Thank You!