DS CH8
DS CH8
DS CH8
DISTRIBUTED FILE
SYSTEMS
From Chapter 8 of Distributed Systems
Concepts and Design,4th Edition,
1
DISTRIBUTED FILE SYSTEM
Topics
Introduction
File Service Architecture
DFS: Case Studies
Case Study: Sun NFS
Case Study: The Andrew File System
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
DISTRIBUTED FILE SYSTEM
Introduction
File system were originally developed for
centralized computer systems and desktop
computers.
File system was as an operating system
facility providing a convenient
programming interface to disk storage.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
3
DISTRIBUTED FILE SYSTEM
Introduction
Distributed file systems support the
sharing of information in the form of files
and hardware resources.
With the advent of distributed object
systems (CORBA, Java) and the web, the
picture has become more complex.
Figure 1 provides an overview of types of
storage system.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
4
DISTRIBUTED FILE SYSTEM
Introduction
Sharing Persis- Distributed Consistency Example
tence cache/replicas maintenance
Main memory 1 RAM
File system 1 UNIX file system
Distributed file system Sun NFS
Web Web server
Introduction
Figure 2 shows a typical layered module
structure for the implementation of a non-
distributed file system in a conventional
operating system.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
6
DISTRIBUTED FILE SYSTEM
Introduction
Introduction
File systems are responsible for the
organization, storage, retrieval, naming,
sharing and protection of files.
Files contain both data and attributes.
A typical attribute record structure is
illustrated in Figure 3.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
8
DISTRIBUTED FILE SYSTEM
Introduction
File length
Creation timestamp
Read timestamp
Write timestamp
Attribute timestamp
Reference count
Owner
File type
Access control list
Introduction
Figure 4 summarizes the main operations
on files that are available to applications in
UNIX systems.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
10
DISTRIBUTED FILE SYSTEM
Introduction
Figure 4. UNIX file system operations
filedes = open(name, mode) Opens an existing file with the given name.
filedes = creat(name, mode) Creates a new file with the given name.
Both operations deliver a file descriptor referencing the open
file. The mode is read, write or both.
status = close(filedes) Closes the open file filedes.
count = read(filedes, buffer, n) Transfers n bytes from the file referenced by filedes to buffer.
count = write(filedes, buffer, n) Transfers n bytes to the file referenced by filedes from buffer.
Both operations deliver the number of bytes actually transferred
and advance the read-write pointer.
pos = lseek(filedes, offset, Moves the read-write pointer to offset (relative or absolute,
whence) depending on whence).
status = unlink(name) Removes the file name from the directory structure. If the file
has no other names, it is deleted.
status = link(name1, name2) Adds a new name (name2) for a file (name1).
status = stat(name, buffer) Gets the file attributes for file name into buffer.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
11
DISTRIBUTED FILE SYSTEM
Introduction
Distributed File system requirements
Related requirements in distributed file systems
are:
Transparency
Concurrency
Replication
Heterogeneity
Fault tolerance
Consistency
Security
Efficiency
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
12
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
13
DISTRIBUTED FILE SYSTEM
Client module
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
15
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
16
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
17
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
18
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
20
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
22
DISTRIBUTED FILE SYSTEM
IP address date
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
23
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
24
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
25
DISTRIBUTED FILE SYSTEM
NFS architecture
Application Application
program program
UNIX
system calls
UNIX kernel
UNIX kernel Virtual file system Virtual file system
Operations Operations
on local files on
file system
remote files
UNIX NFS NFS UNIX
file file
Other
client server
system system
NFS protocol
Figure 8. NFS architecture (remote operations)
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
26
*
DISTRIBUTED FILE SYSTEM
fh = file handle:
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
27
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
28
DISTRIBUTED FILE SYSTEM
Remote Remote
people students x staff users
mount mount
Note: The file system mounted at /usr/students in the client is actually the sub-tree located at /export/people in Server 1;
the file system mounted at /usr/staff in the client is actually the sub-tree located at /nfs/users in Server 2.
Figure 10. Local and remote file systems accessible on an NFS client
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
32
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
33
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
34
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
35
DISTRIBUTED FILE SYSTEM
37
DISTRIBUTED FILE SYSTEM
t freshness guarantee
Tc time when cache entry was last
validated
Tm time when block was last
updated at server
T current time
38
DISTRIBUTED FILE SYSTEM
39
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
41
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
42
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
45
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
46
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
47
DISTRIBUTED FILE SYSTEM
Workstations Servers
User Venus
program
Vice
UNIX kernel
UNIX kernel
Vice
Venus
User
program UNIX kernel
UNIX kernel
Local Shared
/ (root)
bin
Symbolic
links
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
51
DISTRIBUTED FILE SYSTEM
Workstation
User Venus
program
UNIX file Non-local file
system calls operations
UNIX kernel
UNIX file system
Local
disk
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
52
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
53
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
55
DISTRIBUTED FILE SYSTEM
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
56