Professional Documents
Culture Documents
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
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
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
Introduction
Sharing Persis- Distributed Consistency Example tence cache/replicas maintenance
Main memory File system Distributed file system Web Distributed shared memory Remote objects (RMI/ORB) Persistent object store
Peer-to-peer storage system
1 1
RAM UNIX file system Sun NFS Web server Ivy (Ch. 18)
1 1
Introduction Figure 2 shows a typical layered module structure for the implementation of a nondistributed file system in a conventional operating system.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
Introduction
Direct ory module: File module: Ac cess c ont rol module: File ac cess module: Block module: Dev ice module: relat es f ile nam es t o f ile I Ds relat es f ile IDs to partic ular f iles chec ks permission f or operat ion request ed reads or writ es f ile data or att ribut es ac cess es and alloc at es disk block s dis k I/ O and buf f ering
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
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
Introduction
Figure 4. UNIX file system operations
filedes = open(name, mode) filedes = creat(name, mode) Opens an existing file with the given name. 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. Closes the open file filedes. Transfers n bytes from the file referenced by filedes to buffer. 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. Moves the read-write pointer to offset (relative or absolute, depending on whence). Removes the file name from the directory structure. If the file has no other names, it is deleted. Adds a new name (name2) for a file (name1). Gets the file attributes for file name into buffer.
11
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
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
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
13
14
15
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
16
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
17
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
18
Write(FileId, i, Data)
-throws BadPosition Create() -> FileId
Delete(FileId)
GetAttributes(FileId) -> Attr SetAttributes(FileId, Attr)
19
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
20
GetNames(Dir, Pattern) -> NameSeq Returns all the text names in the directory that match the
regular expression Pattern.
21
File Group
A file group is a collection of files that can be located on any server or moved between servers while maintaining the same names.
A similar construct is used in a UNIX file system. It helps with distributing the load of file serving between several servers. File groups have identifiers which are unique throughout the system (and hence for an open system, they must be globally unique).
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
22
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
23
24
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
25
NFS architecture
Client computer Server computer
UNIX kernel
Virtual file system Operations on remote files
NFS client
NFS server
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
Case Study: Sun NFS The file identifiers used in NFS are called file handles.
fh = file handle:
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
27
Case Study: Sun NFS A simplified representation of the RPC interface provided by NFS version 3 servers is shown in Figure 9.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
28
29
Kerberos has been integrated with NFS to provide a stronger and more comprehensive security solution.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
30
Server maintains a table of clients who have mounted filesystems at that server. Each client maintains a table of mounted file systems holding:
< IP address, port number, file handle>
Remote file systems may be hard-mounted or soft-mounted in a client computer. Figure 10 illustrates a Client with two remotely mounted file stores.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
31
export
. . . vmunix usr
nf s
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
33
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
34
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
35
36
38
39
40
Lookup() accounts for 50% of operations -due to step-by-step pathname resolution necessitated by the naming and mounting semantics.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
41
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
42
Mobility transparency:
Hardly achieved; relocation of files is not possible, relocation of filesystems is possible, but requires updates to client configurations.
Scalability transparency:
File systems (file groups) may be subdivided and allocated to separate servers. Ultimately, the performance limit is determined by the load on the server holding the most heavily-used filesystem (file group).
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
43
Fault tolerance:
Limited but effective; service is suspended if a server fails. Recovery from failures is aided by the simple stateless design.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
44
Security:
Recent developments include the option to use a secure RPC implementation for authentication and the privacy and security of the data transmitted with read and write operations.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
45
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
46
Like NFS, AFS provides transparent access to remote shared files for UNIX programs running on workstations. AFS is implemented as two software components that exist at UNIX processes called Vice and Venus.
(Figure 11)
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
47
Vic e
UNI X k ernel Venus Us er program UNI X k ernel Vic e Venus Us er program UNI X k ernel Network
UNI X k ernel
48
Case Study: The Andrew File System (AFS) The files available to user processes running on workstations are either local or shared. Local files are handled as normal UNIX files. They are stored on the workstations disk and are available only to local user processes. Shared files are stored on servers, and copies of them are cached on the local disks of workstations. The name space seen by user processes is illustrated in Figure 12.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
49
tmp
bin
. . .
v munix
cm u
bin
Sy mbolic links
50
Case Study: The Andrew File System (AFS) The UNIX kernel in each workstation and server is a modified version of BSD UNIX. The modifications are designed to intercept open, close and some other file system calls when they refer to files in the shared name space and pass them to the Venus process in the client computer.
(Figure 13)
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
51
Venus
Local dis k
52
Case Study: The Andrew File System (AFS) Figure 14 describes the actions taken by Vice, Venus and the UNIX kernel when a user process issues system calls.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
53
Ne t
Vic e
I f File Nam e re f er s to a fi le i sh ar e d file sp ac e, n Ch e ck list o f f il s in e p ass the re q ue st to loc al ca c he . I f n ot Ve nu s. p re se nt o r the re is n o v alid c allba ck prom i , se sen d a r e qu est f o r the fi le t t e V i e ser v er o h c tha t is cu sto dian of the v olum e co n t ining the a fi . le Pla ce t e c op y o f the h fi le i t e lo ca l f il n h e sy stem , en ter i ts l ca l o n am e i t e lo ca l c ac he n h list an d r etu rn t e lo ca l h n am e t UNI X. o
Op en t e lo ca l f il an d h e r etu rn th e f il e d escr ipto r to the a pp l ation . ic rea d( FileD escripto r, Bu ffer, le ng t ) h write( FileD escripto r, Bu ffer, le ng t ) h c l se( FileD escripto r) o Pe r fo rm a no rm al UN IX r e ad o pe r ation o n the lo ca l c op y . Pe r fo rm a no rm al UN IX w rite o pe ra tion o n the lo ca l c op y .
Clo se t e lo ca l c op y h a nd n otif y Ve nu s th at o the file h as be en close d. I f the l c al co py h a s b ee n ch a ng ed , sen d a c op y to the Vice se rv er tha t is t e c ustod ian o f h the file.
Re p l ce t e f il a h e c on t nts an d sen d a e c allba ck to all oth er c l nts h old ing ca llba ck ie p ro mise s on t e f il . h e
54
Case Study: The Andrew File System (AFS) Figure 15 shows the RPC calls provided by AFS servers for operations on files.
Couloris,Dollimore and Kindberg Distributed Systems: Concepts & Design Edn. 4 , Pearson Education 2005
55
ReleaseLock(fid)
RemoveCallback(fid)
BreakCallback(fid)
Informs server that a Venus process has flushed a file from its cache. This call is made by a Vice server to a Venus process. It cancels the callback promise on the relevant file.
56