5 Distributed File System
5 Distributed File System
DISTRIBUTED FILE
SYSTEMS
Topics
Introduction
File Service Architecture
DFS: Case Studies
Case Study: Sun NFS
Case Study: The Andrew File System
Introduction
Introduction
Introduction
1
1
Filesystem
Distributedfilesystem
RAM
UNIXfilesystem
Web
SunNFS
Webserver
Distributedsharedmemory
Ivy(Ch.18)
Remoteobjects(RMI/ORB)
Persistentobjectstore
1
1
CORBA
CORBAPersistent
ObjectService
OceanStore(Ch.10)
Peertopeerstoragesystem
Typesofconsistencybetweencopies:
1strictonecopyconsistency
approximateconsistency
Xnoautomaticconsistency
Introduction
Introduction
Directory module:
File module:
Block module:
Device module:
Introduction
Introduction
File length
Creation timestamp
Read timestamp
Write timestamp
Attribute timestamp
Reference count
Owner
File type
Access control list
Introduction
10
Introduction
Opensanexistingfilewiththegivenname.
Createsanewfilewiththegivenname.
Bothoperationsdeliverafiledescriptorreferencingtheopen
file.Themodeisread,writeorboth.
Closestheopenfilefiledes.
Transfersnbytesfromthefilereferencedbyfiledestobuffer.
Transfersnbytestothefilereferencedbyfiledesfrombuffer.
Bothoperationsdeliverthenumberofbytesactuallytransferred
andadvancethereadwritepointer.
Movesthereadwritepointertooffset(relativeorabsolute,
dependingonwhence).
Removesthefilenamefromthedirectorystructure.Ifthefile
hasnoothernames,itisdeleted.
Addsanewname(name2)forafile(name1).
Getsthefileattributesforfilenameintobuffer.
11
Introduction
Transparency
Concurrency
Replication
Heterogeneity
Fault tolerance
Consistency
Security
Efficiency
12
Transparency
16
Server computer
Directory service
19
21
22
Access control
In distributed implementations, access
rights checks have to be performed at
the server because the server RPC
interface is an otherwise unprotected
point of access to files.
Directory service interface
Figure 7 contains a definition of the RPC
interface to a directory service.
23
24
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).
25
16bits
IPaddress
date
26
27
28
NFS architecture
Client computer
Server computer
Application Application
program
program
UNIX
system calls
Virtual file system
Operations
on local files
UNIX
file
system
Other
file system
UNIX kernel
UNIX kernel
Operations
on
remote files
NFS
client
NFS
server
UNIX
file
system
NFS protocol
(remote operations)
29
30
31
32
33
34
Client
(root)
(root)
export
...
(root)
usr
nfs
Remote
people
vmunix
Server 2
mount
...
Remote
students
staff
mount
users
Note:Thefilesystemmountedat/usr/studentsintheclientisactuallythesub
treelocatedat/export/peopleinServer1;
thefilesystemmountedat/usr/staffintheclientisactuallythesubtree
locatedat/nfs/usersinServer2.
35
Figure 10. Local and remote file systems accessible on an NFS client
36
37
38
40
41
42
44
45
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).
46
Fault tolerance:
Limited but effective; service is suspended if a
server fails. Recovery from failures is aided by
the simple stateless design.
47
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.
48
49
50
Servers
User Venus
program
Vice
UNIX kernel
UNIX kernel
User Venus
program
UNIX kernel
Network
Vice
Venus
User
program
UNIX kernel
UNIX kernel
Shared
/ (root)
tmp
bin
. . .
vmunix
cmu
bin
Symbolic
links
54
User
program
Venus
UNIX file
system calls
Non-local file
operations
UNIX kernel
UNIX file system
Local
disk
56
Userprocess
open(FileName,
mode)
UNIXkernel
DISTRIBUTED
FILE
SYSTEM
Net
Vice
If FileNamereferstoa
fileinsharedfilespace,
Checklistoffilesin
passtherequestto
localcache.Ifnot
Venus.
presentorthereisno
valid callbackpromise
,
sendarequestforthe
filetotheViceserver
thatiscustodianofthe
volumecontainingthe
file.
Openthelocalfileand
returnthefile
descriptortothe
application.
read(FileDescriptor,
Buffer,length)
Venus
Placethecopyofthe
fileinthelocalfile
system,enteritslocal
nameinthelocalcache
listandreturnthelocal
nametoUNIX.
Transferacopyofthe
fileanda callback
promisetothe
workstation.Logthe
callbackpromise.
Performanormal
UNIXreadoperation
onthelocalcopy.
write(FileDescriptor, Performanormal
Buffer,length)
UNIXwriteoperation
onthelocalcopy.
close(FileDescriptor) Closethelocalcopy
andnotifyVenusthat
thefilehasbeenclosed. Ifthelocalcopyhas
beenchanged,senda
copytotheViceserver
thatisthecustodianof
thefile.
Replacethefile
contentsandsenda
callbacktoallother
clientsholding57
callback
promisesonthefile.
58
ReleaseLock(fid)
RemoveCallback(fid)
BreakCallback(fid)
Returnstheattributes(status)and,optionally,thecontentsoffile
identifiedbythefidandrecordsacallbackpromiseonit.
Updatestheattributesand(optionally)thecontentsofaspecified
file.
Createsanewfileandrecordsacallbackpromiseonit.
Deletesthespecifiedfile.
Setsalockonthespecifiedfileordirectory.Themodeofthe
lockmaybesharedorexclusive.Locksthatarenotremoved
expireafter30minutes.
Unlocksthespecifiedfileordirectory.
InformsserverthataVenusprocesshasflushedafilefromits
cache.
ThiscallismadebyaViceservertoaVenusprocess.Itcancels
thecallbackpromiseontherelevantfile.