Slides for Chapter 8: Distributed File Systems From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education.

Slides:



Advertisements
Similar presentations
DISTRIBUTED FILE SYSTEMS
Advertisements

Distributed Storage March 12, Distributed Storage What is Distributed Storage?  Simple answer: Storage that can be shared throughout a network.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 12: Distributed.
CS6223: Distributed Systems Distributed File Systems.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Slides for Chapter 8: Distributed File Systems
File System Implementation
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
CS Distributed Computing Systems Chapter 8: Distributed File Systems Chin-Chih Chang, From Coulouris, Dollimore and Kindberg Distributed.
1 Reliable Distributed Systems Stateless and Stateful Client- Server Systems.
Chapter 10: File-System Interface
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Distributed File Systems Steve Ko Computer Sciences and Engineering University at Buffalo.
Networked File System CS Introduction to Operating Systems.
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Distributed File Systems
Distributed File Systems
Distributed File Systems
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Lecture 7: Distributed File Systems Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Distributed system Distributed File System Nguyen Huu Tuong Vinh Huynh Thi Thu Thuy Dang Trang Tri.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
DISTRIBUTED FILE SYSTEM 1 DISTRIBUTED FILE SYSTEMS From Chapter 8 of Distributed Systems Concepts and Design,4 th Edition, By G. Coulouris, J. Dollimore.
1 Chap8 Distributed File Systems  Background knowledge  8.1Introduction –8.1.1 Characteristics of File systems –8.1.2 Distributed file system requirements.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 12: Distributed.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Distribuerede.
DISTRIBUTED FILE SYSTEMS Pages - all 1. Topics  Introduction  File Service Architecture  DFS: Case Studies  Case Study: Sun NFS  Case Study: The.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Lecture 27-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) December 3, 2013 Lecture 27 Distributed File Systems.
Distributed System and Middleware Distributed Systems Distributed File System Dr. Sunny Jeong. Mr. Coling Zhang
DISTRIBUTED FILE SYSTEM 1 DISTRIBUTED FILE SYSTEMS.
Lecture 27-1 Lecture 28-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) December 6, 2012 Lecture.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
Information Management NTU Distributed File Systems.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
1 Reliable Distributed Systems Stateless and Stateful Client- Server Systems.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
1 Distribuerede systemer og sikkerhed – 4. marts 2002 zFrom Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design zEdition 3, © Addison-Wesley.
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
Distributed Systems Coulouris 5’th Ed Distributed Systems Distributed File Systems Understand a Generic Distributed File System Understand.
Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
DISTRIBUTED FILE SYSTEM- ENHANCEMENT AND FURTHER DEVELOPMENT BY:- PALLAWI(10BIT0033)
1 Reliable Distributed Systems Stateless and Stateful Client- Server Systems Based on K. Birman’s of Cornell, Dusseu’s of Wisconsin.
Jonathan Walpole Computer Science Portland State University
Distributed Systems Course Distributed File Systems
Distributed File Systems (DFS)
Lecture 25: Distributed File Systems
File System Implementation
Chapter 8: Distributed File Systems
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Slides for Chapter 8: Distributed File Systems
Distributed File Systems
Distributed File Systems
Distributed Systems Course Distributed File Systems
Exercises for Chapter 8: Distributed File Systems
Distributed File System
Lecture 25: Distributed File Systems
Distributed file system
Distributed File Systems
Chapter 15: File System Internals
Today: Distributed File Systems
Distributed File Systems
Lecture 4: File-System Interface
Network File System (NFS)
Presentation transcript:

Slides for Chapter 8: Distributed File Systems From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education 2005

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Learning Objectives zUnderstand the requirements that affect the design of distributed storage services zCase study on NFS: understand how a relatively simple, widely used service is designed

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Distributed storage systems zEarlier storage systems are file systems (e.g. NFS); units are files. zMore recently, distributed object systems (e.g. CORBA, Java); units are objects.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Storage systems and their properties SharingPersis- tence Distributed cache/replicas Consistency maintenance Example Main memory RAM File systemUNIX file system Distributed file systemSun NFS Web Web server Distributed shared memoryIvy (DSM, Ch. 18) Remote objects (RMI/ORB)CORBA Persistent object store 1 CORBA Persistent Object Service Peer-to-peer storage system OceanStore (Ch. 10) Types of consistency: 1: strict one-copy. : slightly weaker guarantees. 2: considerably weaker guarantees.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Characteristics of (non-distributed) file systems zdata and attributes (Fig 8.3) zdirectory: mapping from text names to internal file identifiers zlayers of modules in file systems (Fig 8.2) zfile operation system calls in UNIX (Fig. 8.4)

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 File attributes File length Creation timestamp Read timestamp Write timestamp Attribute timestamp Reference count Owner File type Access control list

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 File system modules

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 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. status = close(filedes)Closes the open file filedes. count = read(filedes, buffer, n) count = write(filedes, buffer, n) 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. pos = lseek(filedes, offset, whence) Moves the read-write pointer to offset (relative or absolute, 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.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Distributed file system requirements ztransparency: yaccess ylocation ymobility yperformance yscaling zconcurrent file updates zfile replication zconsistency zfault tolerance zhardware and os heterogeneity zsecurity zefficiency

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 File service architecture (Author’s model) Client computerServer computer Application program Application program Client module Flat file service Directory service

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 File service architecture zFlat file service yunique file identifiers (UFID) zDirectory service ymap names to UFIDs zClient module yintegrate/extend flat file and directory services yprovide a common application programming interface (can emulate different file interfaces) ystores location of flat file and directory services

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Flat file service interface zRPC used by client modules ynot by user-level programs (which use client modules) zMore fault tolerant compared to UNIX yRepeatable (idempotent) operations x[except for Create: re-execution gets a new file] xat-least-once semantics xno open (hence close) so no state to remember xspecify starting location and UFID (from directory service) in Read/Write yStateless server xCan be restarted without the server or client restoring any state information

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Flat file service operations Read(FileId, i, n) -> Data —throws BadPosition If 1 ≤ i ≤ Length(File): Reads a sequence of up to n items from a file starting at item i and returns it in Data. Write(FileId, i, Data) —throws BadPosition If 1 ≤ i ≤ Length(File)+1: Writes a sequence of Data to a file, starting at item i, extending the file if necessary. Create() -> FileIdCreates a new file of length 0 and delivers a UFID for it. Delete(FileId) Removes the file from the file store. GetAttributes(FileId) -> Attr Returns the file attributes for the file. SetAttributes(FileId, Attr) Sets the file attributes (only those attributes that are not shaded in Figure 8.3).

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Access control zUNIX checks access rights when a file is opened ysubsequent checks during read/write are not necessary zdistributed environment yserver has to check ystateless approaches 1.access check once when UFID is issued client gets an encoded "capability" (who can access and how) capability is submitted with each subsequent request 2.access check for each request. ysecond is more common

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Directory service operations Lookup(Dir, Name) -> FileId — throws NotFound Locates the text name in the directory and returns the relevant UFID. If Name is not in the directory, throws an exception. AddName(Dir, Name, FileId) —throws NameDuplicate If Name is not in the directory, adds (Name, File) to the directory and updates the file’s attribute record. If Name is already in the directory: throws an exception. UnName(Dir, Name) —throws NotFound If Name is in the directory: the entry containing Name is removed from the directory. If Name is not in the directory: throws an exception. GetNames(Dir, Pattern) -> NameSeq Returns all the text names in the directory that match the regular expression Pattern.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Hierarchical file system zDirectories containing other directories and files zEach file can have more than one name (pathnames) yhow in UNIX, Windows?

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 File groups z a logical collection of files on one server ya server can have more than one group ya group can change server yfilesystems in unix ydifferent devices for non-distributed ydifferent hosts for distributed

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Case Study: Sun NFS zIndustry standard for local networks since the 1980’s zOS independent zunix implementation zrpc zudp or tcp

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 NFS architecture: virtual file system UNIX kernel protocol Client computerServer computer system calls LocalRemote UNIX file system NFS client NFS server UNIX file system Application program Application program NFS UNIX UNIX kernel Virtual file system Other file system

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Virtual file system zaccess transparency zpart of unix kernel zNFS file handle, 3 components: yfilesystem identifier xdifferent groups of files yi-node (index node) xstructure for finding the file yi-node generation number xi-nodes are reused xincremented when reused zVFS ystruct for each file system yv-node for each open file xfile handle for remote file xi-node number for local file

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Client integration znfs client emulates Unix file semantics zin the kernel, not in a library, because: yaccess files via system calls ysingle client module for multiple user processes yencryption can be done in the kernel

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Access control znfs server is stateless, doesn't keep open files for clients zserver checks identity each time (uid and gid)

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 NFS server operations (simplified) lookup(dirfh, name) -> fh, attr Returns file handle and attributes for the file name in the directory dirfh. create(dirfh, name, attr) ->  newfh, attr Creates a new file name in directory dirfh with attributes attr and returns the new file handle and attributes. remove(dirfh, name) status Removes file name from directory dirfh. getattr(fh) -> attr Returns file attributes of file fh. (Similar to the UNIX stat system call.) setattr(fh, attr) -> attr Sets the attributes (mode, user id, group id, size, access time and modify time of a file). Setting the size to 0 truncates the file. read(fh, offset, count) -> attr, data Returns up to count bytes of data from a file starting at offset. Also returns the latest attributes of the file. write(fh, offset, count, data) -> attr Writes count bytes of data to a file starting at offset. Returns the attributes of the file after the write has taken place. rename(dirfh, name, todirfh, toname) -> status Changes the name of file name in directory dirfh to toname in directory to todirfh. link(newdirfh, newname, dirfh, name) -> status Creates an entry newname in the directory newdirfh which refers to file name in the directory dirfh. Continues on next slide... What do you notice about read() and write()?

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 NFS server operations (simplified) – 2 symlink(newdirfh, newname, string) -> status Creates an entry newname in the directory newdirfh of type symbolic link with the value string. The server does not interpret the string but makes a symbolic link file to hold it. readlink(fh) -> string Returns the string that is associated with the symbolic link file identified by fh. mkdir(dirfh, name, attr) -> newfh, attr Creates a new directory name with attributes attr and returns the new file handle and attributes. rmdir(dirfh, name) -> status Removes the empty directory name from the parent directory dirfh. Fails if the directory is not empty. readdir(dirfh, cookie, count) -> entries Returns up to count bytes of directory entries from the directory dirfh. Each entry contains a file name, a file handle, and an opaque pointer to the next directory entry, called a cookie. The cookie is used in subsequent readdir calls to start reading from the following entry. If the value of cookie is 0, reads from the first entry in the directory. statfs(fh) -> fsstats Returns file system information (such as block size, number of free blocks and so on) for the file system containing a file fh.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Mount service zthe process of including a new filesystem is called mounting z/etc/exports has filesystems that can be mounted by others zclients use a modified mount command for remote filesystems zcommunicates with the mount process on the server in a mount protocol zhard-mounted yuser process is suspended until request is successful ywhen server is not responding yrequest is retried until it's satisfied zsoft-mounted yif server fails, client returns failure after a small # of retries yuser process handles the failure

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Local and remote file systems 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.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Pathname translation zpathname: /users/students/dc/abc zserver doesn't receive the entire pathname for translation, why? zclient breaks down the pathnames into parts ziteratively translate each part ztranslation is cached

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Automounter zwhat if a user process reference a file on a remote filesystem that is not mounted ztable of mount points (pathname) and servers zNFS client sends the reference to the automounter zautomounter check find the first server that is up zmount it at some location and set a symbolic link (original impl) zmount it at the mount point (later impl) zcould help fault tolerance, the same mount point with multiple replicated servers.

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Server caching zcaching file pages, directory/file attributes zread-ahead: prefetch pages following the most-recently read file pages zdelayed-write: write to disk when the page in memory is needed for other purposes z"sync" flushes "dirty" pages to disk every 30 seconds z two write option 1.write-through: write to disk before replying to the client 2.cache and commit: xstored in memory cache xwrite to disk before replying to a "commit" request from the client

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Client caching zcaches results of read, write, getattr, lookup, readdir zclients responsibility to poll the server for consistency

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Client caching: reading (1) ztimestamp-based methods for consistency validation y Tc: time when the cache entry was last validated y Tm: time when the block was last modified at the server zcache entry is valid if: 1. T - Tc < t, where t is the freshness interval x t is adaptively adjusted: files: 3 to 30 seconds depending on freq of updates directories: 30 to 60 seconds 2.Tm client = Tm server

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Client caching: reading (2) zneed validation for all cache accesses zcondition #1 can be determined by the client alone-- performed first zReducing getattr() to the server [for getting Tm server ] 1.new value of Tm server is received, apply to all cache entries from the same file 2. piggyback getattr() on file operations 3. adaptive alg for update t (condition #1) zvalidation doesn't guarantee the same level of consistency as one-copy

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Client caching: writing zdirty: modified page in cache zflush to disk: file is closed or sync from client zbio-daemon (block input-output) yread-ahead: after each read request, request the next file block from the server as well ydelayed write: after a block is filled, it's sent to the server yreduce the time to wait for read/write

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Other optimization zUDP, RPC zextended to 9 kilobytes--entire block in a single packet

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Security zstateless nfs server zuser's identity in each request zKerberos authentication during the mount process, which includes uid and host address zserver maintain authentication info for the mount zon each file request, nfs checks the uid and address zone user per client

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Performance zoverhead/penalty is low zmain problems yfrequent getattr() for cache validation (piggybacking) yrelatively poor performance if write-through is used on the server (delay-write/commit in current versions) zwrite < 5% zlookup is almost 50% (step by step pathname translation)

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 Summary for NFS zaccess transparency: same system calls for local or remote files zlocation transparency: could have a single name space for all files (depending on all the clients to agree the same name space) zmobility transparency: mount table need to be updated on each client (not transparent) zscalability: can usually support large loads, add processors, disks, servers... zfile replication: read-only replication, no support for replication of files with updates zhardware and OS: many ports zfault tolerance: stateless and idempotent zconsistency: not quite one-copy for efficiency zsecurity: added encryption--Kerberos zefficiency: pretty efficient, wide-spread use

Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 4 © Pearson Education 2005 WebNFS (p. 360) zHTTP and NFS both can read files, what NFS can do more than HTTP in terms of reading? [what can read() do in a file system that HTTP can’t?] zNFS is designed to be on “fast” LANs zWebNFS is designed to be on “slower” WANs zWebNFS clients talk to NFS servers ySmall set up cost (thiner client) xpublic files, mostly read access, no authentication xno mounting yaccess portions of a file znfs://xyz.com/someFile