Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.

Similar presentations


Presentation on theme: "Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems."— Presentation transcript:

1 Chapter Five Distributed file systems

2 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems Summary ☞

3 3 Distributed File System -In distributed system the job of the file system is to store programs and data and make them available as needed. -The file service is the specification of what the file system offers to its clients. - The file server is process that runs on some machine and helps implement the file service.

4 4 Distributed File System Design File Service Interface File services can be split into two types : 1.The upload/download model. see (a) 2.The remote access model. see (b) 2.Accesses are done on client 3.When client is done, file is returned to server 1. File moved to client Old file Server Client Server File stays on server Requests from client to access remote file (a) (b)

5 5 Distributed File System Design Directory Server Interface All distributed system allow directories to contain subdirectories, and so on, leading to a Three of directories, often called a hierarchical file system. It is possible to create pointers to an arbitrary tree, these can be put in any directory making arbitrary directory graphs, which more powerful. A B C D E 2 1 0 A 1 1 B C D E Machine 2 Machine 1 Count of number of directories pointing to this directory

6 6 Distributed File System Design Naming Transparency There are three common approaches to file and directory naming in a distributed system: 1.Machine + path naming, such as /machine/path 2.Mounting remote file systems onto the local file hierarchy 3.A single name space that looks the same on all machines

7 7 Distributed File System Design Two Level Naming Most distributed system use some form of two-level naming Symbolic names. Binary names. a b a b c a b a b c B A A B Single processor 1. Write “c” Original file 2. Read gets “abc” 2.Write “c” Client 1 1. Read “ab” File server 3. Read gets “ab” Client 2

8 8 Distributed File System Design Semantics of File Sharing When two or more users share the same file, it is necessary to define the semantics of reading and writing precisely to avoid problems.

9 9 Semantics of File Sharing Four ways of dealing with the shared files in a distributed system UNIX semantics Session semantics Immutable files Transaction Every operation on a file is instantly visible to all processes No changes are visible to other processes until the file is closed No updates are possible; simplifies sharing and replication All changes have the all-or-nothing property Method Comment Distributed File System Design

10 10 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems Summary ☞

11 11 Distributed File System Implementation File Usage Observed file system properties Reading is much more common than writing Most files are small (less than 10 k) Reads and writes are sequential; random access is rare Most files have a short lifetime File sharing is unusual The average process uses only a few files Distinct file classes with different properties exit

12 12 Distributed File System Implementation System structure -A comparison of stateless and stateful servers Fault tolerance No Open/Close calls needed No limits on number of open files No problem if a client crashes Shorter request messages Better performance Read ahead possible Idempotency easier Advantages of stateless servers Advantages of stateful servers No problems if a client crashes File locking possible

13 13 Distributed File System Implementation Caching In a client-server system, each with main memory and a disk, there are four places to store files : Client’s main memory Client’s disk (optional) Server’s main memory Server’s disk Network 3 4 2 1

14 14 Distributed File System Implementation Cache Consistency If two clients simultaneously read the same file and then both modify it, several problems occur.For one, when a third process reads the file from the server, it will get original version, not one of the two new ones. Write through Delayed write Write on close Centralized control Works, but does not affect write traffic Better performance but possibly ambiguous semantics Matches session semantics UNIX semantics,but not robust and scales poorly Method Comments Four algorithms for managing a client file cache

15 15 Distributed File System Design Replication S1 C S2 S3 1 2 3 S1 S2 S3 C Group Later S1 S2 S3 C Now Client Server Explicit file replication Lazy file replication File replication using a group

16 16 Distributed File System Design Update Protocols A B C D E F G H I J K L A B C D E F G H I J K L A B C D E F G H I J K L Nr=3, Nw=10 Nr=7, Nw=7Nr=1, Nw=12 Read quorum Write quorum Three examples of the voting algorithm

17 17 Example :Sun ’ s network File System NFS Architecture : -The basic idea behind NFS is to allow an arbitrary collection of clients and severs to share a common file system. -NFS allows every machine to be both a client and a server at the same time. -Each NFS server exports one or more of its directories for access by remote clients. What is a protocol? A protocol is a set of requests sent by clients to servers, along with the corresponding replies sent by the servers back to the clients. NFS Protocols : The first NFS protocol handles mounting. A client can send a path name to a server and request permission to mount that directory somewhere in its directory hierarchy. The second NFS protocol is for directory and file access. Clients can send messages to servers to manipulate directories and to read and write files.

18 18 NFS Implementation System call layer Virtual file system layer Local operating system NFS client Local disk Message to server Virtual file system layer NFS server Local operating system Local disk Message from client Client Server Network NFS Layer structure

19 19 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems Summary ☞

20 20 Summary The distributed file system the heart of a distributed system File sharing in a distributed system Complex Important topic Implementing a distributed file system Stateless Stateful Caching File replication Future distributed file system Hardware technology Scalability Wide-area systems Mobile users Fault tolerance

21 Thank You

22 22


Download ppt "Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems."

Similar presentations


Ads by Google