Distributed File Systems
Distributed File Systems
Sharing devices
Special case of sharing files
E.g.,
NFS (Suns Network File System) Windows NT, 2000, XP Andrew File System (AFS) & others
CS-4513, D-Term 2007 Distributed File Systems 2
Location independence file name does not need to be changed when the files physical storage location changes.
Better file abstraction. Promotes sharing the storage space itself. Separates the naming hierarchy from the storage-devices hierarchy.
CS-4513, D-Term 2007 Distributed File Systems 4
E.g.,
Server A sees : /users/steen/mbox Client A sees: /remote/vu/mbox Client B sees: /work/me/mbox
If needed data not already cached, copy of data brought from the server to the local cache.
Copies of parts of file may be scattered in different caches.
Cache-consistency problem keeping the cached copies consistent with the master file.
Especially on write operations
CS-4513, D-Term 2007 Distributed File Systems 9
On client disk
Good when local usage dominates (e.g., AFS) Caches larger files Helps protect clients from server crashes
CS-4513, D-Term 2007 Distributed File Systems 10
11
Server-initiated approach
Server records (parts of) files cached in each client. When server detects a potential inconsistency, it reacts
CS-4513, D-Term 2007 Distributed File Systems 12
Cached System
Many remote accesses handled efficiently by the local cache
Most served as fast as local ones.
Server must reclaim space used by no longer active clients. Increased performance; fewer disk accesses. Server retains knowledge about file
E.g., read ahead next blocks for sequential access E.g., file locking for managing writes
Windows
CS-4513, D-Term 2007 Distributed File Systems 15
Failure Recovery: Stateless server failure and recovery are almost unnoticeable.
Newly restarted server responds to self-contained requests without difficulty.
CS-4513, D-Term 2007 Distributed File Systems 16
DFS Replication
Replicas of the same file reside on failure-independent machines. Improves availability and can shorten service time. Naming scheme maps a replicated file name to a particular replica.
Existence of replicas should be invisible to higher levels. Replicas must be distinguished from one another by different lower-level names.
Updates
Replicas of a file denote the same logical entity Update to any replica must be reflected on all other replicas.
18
NFS
Sun Network File System (NFS) has become de facto standard for distributed UNIX file access. NFS runs over LAN
even WAN (slowly)
21
22
NFS Implementation
NFS
23
NFS Operations
Lookup
Fundamental NFS operation Takes pathname, returns file handle
File Handle
Unique identifier of file within server Persistent; never reused Storable, but opaque to client
64 bytes in NFS v3; 128 bytes in NFS v4
Conspicuously absent
open, close
25
All hard work done on client side Every operation provides file handle Server caching
Performance only Based on recent usage
Client caching
Client checks validity of caches files Client responsible for writing out caches
CS-4513, D-Term 2007 Distributed File Systems 26
27
28
NFS Implementation
Remote procedure calls for all operations
Implemented in Sun ONC XDR is interface definition language
NFS Caching
On client open(), client asks server if its cached attribute blocks are up to date. Once file is open, different client processes can write it and get inconsistent data.
Summary NFS
That was version 3 of NFS
Stateless file system High performance, simple protocol Based on UDP
NFS Version 4
Stateful file service Based on TCP reliable transport protocol More ways to access server Compound requests
I.e., multiple RPC calls in same packet
More emphasis on security Mount protocol integrated with rest of NFS protocol
CS-4513, D-Term 2007 Distributed File Systems 33
NFS Version 4
34
Also
Open() and close(). With a server crash, some information may have to be recovered
See
Silbershatz, p. 653
http://www.tcpipguide.com/free/t_TCPIPNetworkFileSystemNFS. htm
CS-4513, D-Term 2007 Distributed File Systems 35
Questions?
36
37
AFS
Need for scaling led to reduction of client-server message traffic.
Once a file is cached, all operations are performed locally. On close, if the file is modified, it is replaced on the server.
The client assumes that its cache is up to date! Server knows about all cached copies of file
Callback messages from the server saying otherwise.
CS-4513, D-Term 2007 Distributed File Systems 39
AFS
On file open()
If client has received a callback for file, it must fetch new copy Otherwise it uses its locally-cached copy.
Server crashes
Transparent to client if file is locally cached Server must contact clients to find state of files
Reading Assignment
Silbershatz, Chapter 17 or Tanenbaum, Modern Operating Systems
8.3 and 10.6.4
42
Questions?
43