mc714 sistemas distribu dos
play

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de - PowerPoint PPT Presentation

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de Computac ao, Unicamp Aulas 21: Sistemas de Arquivos Distributed File Systems General goal Try to make a file system transparently available to remote clients.


  1. MC714: Sistemas Distribu´ ıdos Prof. Lucas Wanner Instituto de Computac ¸ ˜ ao, Unicamp Aulas 21: Sistemas de Arquivos

  2. Distributed File Systems General goal Try to make a file system transparently available to remote clients. 1.�File�moved�to�client Client Server Client Server Old�file New�file Requests�from 2. Accesses�are client�to�access File�stays 3.�When�client�is�done, done�on�client on�server remote�file file�is�returned�to Remote access model Upload/download model Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 2 / 15

  3. Example: NFS Architecture NFS NFS is implemented using the Virtual File System abstraction, which is now used for lots of different operating systems. Client Server System call layer System call layer Virtual file system Virtual file system (VFS) layer (VFS) layer Local file Local file NFS client NFS server system interface system interface RPC client RPC server stub stub Network Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 3 / 15

  4. Example: NFS Architecture Essence VFS provides standard file system interface, and allows to hide difference between accessing local or remote file system. Question Is NFS actually a file system? Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 4 / 15

  5. NFS File Operations Oper. v3 v4 Description Create Yes No Create a regular file Create No Yes Create a nonregular file Link Yes Yes Create a hard link to a file Symlink Yes No Create a symbolic link to a file Mkdir Yes No Create a subdirectory Mknod Yes No Create a special file Rename Yes Yes Change the name of a file Remove Yes Yes Remove a file from a file system Rmdir Yes No Remove an empty subdirectory Open No Yes Open a file Close No Yes Close a file Lookup Yes Yes Look up a file by means of a name Readdir Yes Yes Read the entries in a directory Readlink Yes Yes Read the path name in a symbolic link Getattr Yes Yes Get the attribute values for a file Setattr Yes Yes Set one or more file-attribute values Read Yes Yes Read the data contained in a file Write Yes Yes Write data to a file Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 5 / 15

  6. Cluster-Based File Systems Observation With very large data collections, following a simple client-server approach is not going to work ⇒ for speeding up file accesses, apply striping techniques by which files can be fetched in parallel. File block of file a File block of file e e a c b d e a b c d a b c d e Whole-file distribution a a a b b b c c c e d d e e d File-striped system Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 6 / 15

  7. Example: Google File System file name, chunk index GFS client Master contact address Instructions Chunk-server state Chunk ID, range Chunk server Chunk server Chunk server Chunk data Linux file� Linux file� Linux file� system system system The Google solution Divide files in large 64 MB chunks, and distribute/replicate chunks across many servers: The master maintains only a (file name, chunk server) table in main memory ⇒ minimal I/O Files are replicated using a primary-backup scheme; the master is kept out of the loop Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 7 / 15

  8. P2P-based File Systems Node where a file system is rooted � � � � File system layer Ivy Ivy Ivy Block-oriented storage DHash DHash DHash DHT layer Chord Chord Chord Network Basic idea Store data blocks in the underlying P2P system: Every data block with content D is stored on a node with hash h ( D ) . Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 8 / 15

  9. File sharing semantics Client machine #1 Problem a b Process When dealing with distributed file systems, we A a b c need to take into account the ordering of concurrent read/write operations and expected 1. Read "ab" 2. Write "c" semantics (i.e., consistency). File server Original file b a Single machine a b Process 3. Read gets "ab" A a b c Client machine #2 Process a b B Process B 1. Write "c" 2. Read gets "abc" (a) (b) Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 9 / 15

  10. File sharing semantics Semantics UNIX semantics: a read operation returns the effect of the last write operation ⇒ can only be implemented for remote access models in which there is only a single copy of the file Transaction semantics: the file system supports transactions on a single file ⇒ issue is how to allow concurrent access to a physically distributed file Session semantics: the effects of read and write operations are seen only by the client that has opened (a local copy) of the file ⇒ what happens when a file is closed (only one client may actually win) Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 10 / 15

  11. NFS: Share reservations Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 11 / 15

  12. Example: File sharing in Coda Session S A Client Open(RD) File f Invalidate Close Server Close Open(WR) File f Client Time Session S B Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 12 / 15

  13. Consistency and replication Observation In modern distributed file systems, client-side caching is the preferred technique for attaining performance; server-side replication is done for fault tolerance. Observation Clients are allowed to keep (large parts of) a file, and will be notified when control is withdrawn ⇒ servers are now generally stateful 1. Client asks for file Client Server 2. Server delegates file Old file Local copy 3. Server recalls delegation Updated file 4. Client sends returns file Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 13 / 15

  14. Example: Client-side caching in Coda Session S Session S A A Client A Open(RD) Close Close Open(RD) Invalidate (callback break) File f File f Server File f OK (no file transfer) Open(WR) Open(WR) Close Close Client B Time Session S Session S B B Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 14 / 15

  15. Example: Server-side replication in Coda Server Server S 1 S 3 Broken Client Client Server A network B S 2 Main issue Ensure that concurrent updates are detected: Each client has an Accessible Volume Storage Group (AVSG): is a subset of the actual VSG. Version vector CVV i ( f )[ j ] = k ⇒ S i knows that S j has seen version k of f . Example: A updates f ⇒ S 1 = S 2 = [+ 1 , + 1 , + 0 ] ; B updates f ⇒ S 3 = [+ 0 , + 0 , + 1 ] . Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 15 / 15

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend