Distributed File System Implementation
Distributed File System Implementation
Setia
A Distributed File System ( DFS ) is simply a classical model of a file system ( as discussed before ) distributed across multiple machines. The purpose is to promote sharing of dispersed files. This is an area of active research interest today.
The resources on a particular machine are local to itself. Resources on other machines are remote. A file system provides a service for clients. The server interface is the normal set of file operations: create, read, etc. on files.
DFS- definition
Clients, servers, and storage are dispersed across machines. Configuration and implementation may vary
Servers may run on dedicated machines, OR Servers and clients can be on the same machines. The OS itself can be distributed (with the file system a part of that distribution. A distribution layer can be interposed between a conventional OS and the file system.
Clients should view a DFS the same way they would a centralized FS; the distribution is hidden at a lower level. Performance is concerned with throughput and response time.
- Are clients and servers different? = no distinction between clients and servers. All machines run the same basic software. = the file server and directory server are just user programs, so a system can be configured to run client and server software on the same machines or not, as it wishes. = clients and servers are fundamentally different machines, in terms of either hardware or software.
= combine the two into a single server that handles all the directory and file calls itself. = keep them separated, which is flexible and make software simpler. However, this method requires more communication.
Whether or not file, directory and other servers should
Naming
Naming is the mapping between logical and physical objects.
Example: A user filename maps to <cylinder, sector>. In a conventional file system, it's understood where the file actually
network, is hidden.
File replication means multiple copies of a file; mapping returns a
Transparency
Location transparency a) The name of a file does not reveal any hint of the file's
physical storage location. b)File name still denotes a specific, although hidden, set of physical disk blocks. c) This is a convenient way to share data. d)Can expose correspondence between component units and machines.
Location independence The name of a file doesn't need to be changed when the file's physical
to machine.)
Files are permanently associated with specific disk blocks.
and convenient system upgrades. The performance is not as good. NAMING SCHEMES: There are three main approaches to naming files: 1. Files are named with a combination of host and local name.
This guarantees a unique name. NOT location transparent NOR location
independent.
Same naming works on local and remote files. The DFS is a loose collection
independent.
SUN NFS is a good example of this technique.
3. A single global name structure spans all the files in the system.
The DFS is built the same way as a local file system. Location independent.
IMPLEMENTATION TECHNIQUES
Can Map directories or larger aggregates rather than individual files. A non-transparent mapping technique:
name ----> file_identifier ----> < system, disk, cylinder, sector >
So when changing the physical location of a file, only the file identifier
server caches. Memory must be reclaimed when client closes file or when client dies. Stateless: Each client request provides complete information needed by the server (i.e., filename, file offset ).
The server can maintain information on behalf of the client, but it's
not required. Useful things to keep include file info for the last N files touched.
request. Stateful can have a read-ahead cache. Fault Tolerance: A stateful server loses everything when it crashes.
Server must poll clients in order to renew its state. Client crashes force the server to clean up its encached information. Stateless remembers nothing so it can start easily after a crash.
System Structure
Advantages of stateless servers Fault tolerance No Open/Close calls needed Advantages of stateful servers Shorter request messages
Better performance
No server space wasted on tables Read ahead possible No limits on number of open filesIdempotency easier No problems if a client crashes File locking possible
Cache Consistency Problem -- Keeping the cached copies consistent with the master file.
Caching
CACHING
A remote service ((RPC) has these characteristic steps:
a) The client makes a request for file access.
CACHE LOCATION:
Caching is a mechanism for maintaining disk data on the local machine. This data can be kept in the local memory or in the local disk. Caching can be advantageous both for read ahead and read again. The cost of getting data from a cache is a few HUNDRED instructions; disk accesses cost THOUSANDS of instructions. The master copy of a file doesn't move, but caches contain replicas of portions of the file. Caching behaves just like "networked virtual memory".
CACHE LOCATION:
What should be cached? << blocks <---> files >>. Bigger sizes give a better hit rate; Smaller give better transfer times.
Caching on disk gives:
Better reliability.
Since the server cache is in memory, it allows the use of only one mechanism.
Which would you use for a database file? For file editing?
CACHE CONSISTENCY:
The basic issue is, how to determine that the client-cached data is consistent with what's on the server.
Client - initiated approach -
The client asks the server if the cached data is OK. What should be the frequency of "asking"? On file open, at fixed time interval, ...?
Server - initiated approach -
Possibilities: A and B both have the same file open. When A closes the file, B "discards" its copy. Then B must start over. The server is notified on every open. If a file is opened for writing, then disable caching by other clients for that file. Get read/write permission for each block; then disable caching only for particular blocks.
FILE REPLICATION:
Duplicating files on multiple machines improves availability and performance. Placed on failure-independent machines ( they won't fail together ). Replication management should be "location-opaque". The main problem is consistency - when one copy changes, how do other copies reflect that change? Often there is a tradeoff: consistency versus availability and performance. Example:
"Demand replication" is like whole-file caching; reading a file causes it to be cached locally. Updates are done only on the primary file at which time all other copies are invalidated.
Atomic and serialized invalidation isn't guaranteed ( message could get lost / machine could crash. )
1983 at Carnegie-Mellon University, purchased by IBM and released as Transarc DFS, now open sourced as OpenAFS.
OVERVIEW:
AFS tries to solve complex issues such as uniform name space, location-
independent file sharing, client-side caching (with cache consistency), secure authentication (via Kerberos) Also includes server-side caching (via replicas), high availability Can span 5,000 workstations
AFS
Clients have a partitioned space of file names:
a local name space and a shared name space
Dedicated servers, called Vice, present the shared name space to the clients
AFS
Clients and servers are structured in clusters interconnected by a
backbone LAN
A cluster consists of a collection of workstations and a cluster server and is
information.
Volumes can migrate between servers to balance space and utilization. Old server has "forwarding" instructions and handles client updates during migration.
Read-only volumes ( system files, etc. ) can be replicated. The volume database knows how to find these.
A client workstation interacts with Vice servers only during opening and closing of files Venus caches files from Vice when they are opened, and stores modified copies of files back when they are closed Reading and writing bytes of a file are done by the kernel without Venus intervention on the cached copy Venus caches contents of directories and symbolic links, for path-name translation Exceptions to the caching policy are modifications to directories that are made directly on the server responsibility for that directory
Deflection of open/close: The client kernel is modified to detect references to vice files. The request is forwarded to Venus with these steps: Venus does pathname translation. Asks Vice for the file Moves the file to local disk Passes inode of file back to client kernel. Venus maintains caches for status ( in memory ) and data ( on local disk.)
Thank you