Distributed File Systems

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

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.
Distributed File Systems
Slides for Chapter 8: Distributed File Systems
File System Implementation
Computer Science Lecture 18, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Other File Systems: LFS and NFS. 2 Log-Structured File Systems The trend: CPUs are faster, RAM & caches are bigger –So, a lot of reads do not require.
Other File Systems: AFS, Napster. 2 Recap NFS: –Server exposes one or more directories Client accesses them by mounting the directories –Stateless server.
1 Reliable Distributed Systems Stateless and Stateful Client- Server Systems.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
NETWORK FILE SYSTEM (NFS) By Ameeta.Jakate. NFS NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture.
Network File System (NFS) in AIX System COSC513 Operation Systems Instructor: Prof. Anvari Yuan Ma SID:
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.
Networked File System CS Introduction to Operating Systems.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
Distributed File Systems
Distributed File Systems
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.
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Chapter 10: File-System.
10.1 Silberschatz, Galvin and Gagne ©2005 Operating System Principles 10.4 File System Mounting A file system must be mounted before it can be accessed.
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.
Instructor’s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 © Addison-Wesley Publishers Distribuerede.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Sun Network File System Presentation 3 Group A4 Sean Hudson, Syeda Taib, Manasi Kapadia.
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.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
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.
EE324 INTRO TO DISTRIBUTED SYSTEMS. Distributed File System  What is a file system?
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 Group A5 Amit Sharma Dhaval Sanghvi Ali Abbas.
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.
Distributed Systems: Distributed File Systems Ghada Ahmed, PhD. Assistant Prof., Computer Science Dept. Web:
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 Reliable Distributed Systems Stateless and Stateful Client- Server Systems Based on K. Birman’s of Cornell, Dusseu’s of Wisconsin.
Distributed File Systems (DFS)
File System Implementation
4.3 Network File System (NFS)
Slides for Chapter 8: Distributed File Systems
Distributed File Systems
Multiple Processor Systems
Distributed File Systems
Distributed File Systems
Distributed File Systems
Distributed File System
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM
Distributed File Systems
Distributed file system
Distributed File Systems
Multiple Processor and Distributed Systems
Chapter 15: File System Internals
Today: Distributed File Systems
Distributed File Systems
Lecture 4: File-System Interface
Network File System (NFS)
Presentation transcript:

Distributed File Systems Distributed Systems Distributed File Systems

DFS Goals Access transparency: a single set of file operations for access to both local and remote files. Location transparency: a uniform file name space which does not contain file physical location information. Concurrency transparency: a user’s file operations will not be interfered by another user. Failure transparency: when part of the system fails, the rest of the system can still provide file services. Heterogeneity: interoperable among different operating systems and communication protocols. Scalability: the system performance will not deteriorate as the system size grows. Enable users to access remote files w/o copying to local disk. Support diskless WS

Distributed File System Components Flat file service: offer a simple set of general operations to access attributes and data of files, referred by UFIDs. Directory service: map text names to UFIDs. Client module: allow access to file & directory service under a single application programming interface. Client computer Server computer Application program Client module Flat file service Directory service 3 components. Design motivation: 1) make servers stateless (many good features, lightweight, RPC, etc); 2) separate directory service from file service, the two services actually has different operations and also for load balancing (lightweight server).

Distributed File System Interface Lookup AddName UnName GetNames Read Write Create Delete GetAttributes SetAttributes Client computer Server computer Application program Client module Flat file service Directory service If the Unix file primitives are mapped directly onto file server operations, it is impossible to support many of the requirements outlined on the previous slide. Instead, the file service is implemented in part by a module that runs in the client computer. The Client module implements nearly all of the state-dependent funtionality (open files, position of read-write pointer, etc.)- supporting fault tolerance. It maintains a cache of recently-used file data - efficiency, limited replication and scalability. It translates the file operations performed by applications into the API of the file server - transparency and heterogeneity. It supplies authentication information and performs encryption when necessary, but access control checks must be made by the server. *

Flat file service operations read(UFID, i, n)  Data — throws BadPosition If 1 ≤ i ≤ Length(File), read a sequence of up to n items from a file starting at item i and returns it in Data. write(UFID, i, Data) If 1 ≤ i ≤ Length(File)+1, writes a sequence of Data to a file, starting at item i, extending the file if necessary. create()  UFID Create a new file of length 0 and delivers a UFID for it. delete(UFID) Remove the file from the file store. getAttributes(UFID)  Attr Return the file attributes for the file. setAttributes(UFID, Attr) Set the file attributes (only those attributes that are not shaded in ). All operations are idempotent, RPCs. Where to get UFID ->

Directory service operations Lookup(Dir, Name)  UFID — throws NotFound Locate the text name in the directory and returns the relevant UFID. If Name is not in the directory, throws an exception. AddName(Dir, Name, UFID) NameDuplicate If Name is not in the directory, add (Name, UFID) to the directory and updates the file’s attribute record. If Name is already in the directory, throw an exception. UnName(Dir, Name) If Name is in the directory, the entry containing Name is removed from the directory. If Name is not in the directory, throw an exception. GetNames(Dir, Pattern)  NameSeq Return all the text names in the directory that match the regular expression Pattern.

Constructing a Hierarchical File System A hierarchical file naming system can be constructed by the client module by using file & directory services. The root of the directory tree is a directory with a well-known UFID. A pathname resolution function is provided in the client module.

Differences between DFS and Conventional FS Separation of file service and directory service: The file service is made more general and the design of directory service can be more flexible. It off loads dir service from file server. Stateless servers and emulations in the client module: File server is made very light weighted, leaving most of work to the client module. Server can recover from failure efficiently, with no need to restore client’s states. Client module emulates the traditional FS interface. Repeatable operations File operations are idempotent, allowing the use of at-least-once RPC semantics. Operation create is exceptional.

Capabilities and Access Control Clients interacts with dir-server and file-server via RPCs. There is a security loophole, allowing unauthorized user to use other’s ID to access file illegally. Capability (in the form of a UFID) is a digital key used to identify and access file by clients in distributed FS. A capability includes information of file location (groupID), fid, and access control. Capability = id + location + security + access control 48 bits 32bits 16bits File group ID File number Encrypted permission + random number Unencrypted permission

Capabilities and Access Control Clients must present a capability each time of file access. Directory server generates the capability of a file based on to client’s ID and access permission at name resolution. Capabilities can be used to control individual modes of access to a file. A capability must have an encrypted field to prevent a capability from being modified or mis-used by others. The encryption key is usually shared between the directory server and file server.

File Representation An index block (similar to i-node in UNIX) is used for each file to point to data blocks (or another layer of index blocks). Locating an index block is done by using UFID. The UFIDs can be organized to B-tree structure for efficient search. The mappings from UFIDs to the corresponding index-blocks are stored on disk, and the mappings can be too big to be in memory at once. Server’s location (file group ID) is embedded in UFID. The client needs to know server’s location before making RPC for file access. This can be done by the following RPC to any server: PortID = GetServerPort(FileGroupID) Information of mapping filegroupID  server location is replicated at any server.

Space Leaks Some files whose directory links have been removed may remain on disk and never be accessed, due to the separation of directory servers from file servers. The problem is ignored, or prevented in most of the systems. A “life-time” method aims to solve the problem: the dir-server periodically touch all files, i.e., set a life-time to all files registered with the dir-server. file-server decrements the life-time of all files at some clock rate. The files with life-time 0 will be removed (they are not registered with the dir-server). Directory-server touches files.

The Sun Network File System (NFS) The Network File System (NFS) was developed to allow machines to mount a local directory to a remote file system as if it were on a local disk. It facilitates fast and seamless sharing of files across a network. It is an open standard with clear and simple interfaces (an industry standard for file sharing in LANs since 1980s). It closely follows the abstract file service model defined above.

NFS architecture UNIX kernel protocol Client computer Server computer system calls Local Remote UNIX file system NFS client server Application program Virtual file system Other file system

NFS Virtual File System NFS introduces a Virtual File System (VFS) layer, which maintains an entry per file called v-node (virtual i-node) for every opened file. v-node indicates whether a file is local or remote. For a local file, it contains i-node. For a remote file, it contains the file handle as following: FileSystem id in file-handle is a unique id allocated to each filesystem when it’s created. It’s stored in the superblock of the file system. FileSystem identifier i-node number i-node generation number

NFS Implementation NFS client module resides in the UNIX kernel. It emulates exactly the semantics of UNIX file system. Therefore: application programs can run in NFS without any change. a single client module serves all user processes. NFS client and server modules communicate using Sun RPC system. NFS is stateless. It provides reliable file operations.

NFS server operations (simplified) read(fh, offset, count)  attr, data write(fh, offset, count, data)  attr create(dirfh, name, attr)  newfh, attr remove(dirfh, name) status getattr(fh)  attr setattr(fh, attr)  attr lookup(dirfh, name)  fh, attr rename(dirfh, name, todirfh, toname) link(newdirfh, newname, dirfh, name) readdir(dirfh, cookie, count)  entries symlink(newdirfh, newname, string)  status readlink(fh)  string mkdir(dirfh, name, attr)  newfh, attr rmdir(dirfh, name)  status statfs(fh)  fsstats Modelling flat file service Read(FileId, i, n)  Data Write(FileId, i, Data) Create()  FileId Delete(FileId) GetAttributes(FileId)  Attr SetAttributes(FileId, Attr) Modelling directory service Lookup(Dir, Name)  FileId AddName(Dir, Name, File) UnName(Dir, Name) GetNames(Dir, Pattern)  NameSeq Idempotent read/write getattr is used to implement fstat(), setattr is used to update the attributes NFS Create adds file to directory, whereas we use two operations in MFS *

Mount remote file systems to client in NFS Note: The file system mounted at /usr/students in Client is a sub-tree located at /export/people in Server 1; The file system mounted at /usr/staff in Client is the sub-tree located at /nfs/users in Server 2.

Sharing Resources share [-F FSType] [-o specific_options] [-d description] [pathname] dfshares [-F FSType] [-h] [-o specific_options] [server...] share: exports, or makes a resource available for mounting, through a type specified FSType, or the first file-system-type listed in /etc/dfs/fstypes file. /etc/dfs/fstypes: list of DFS utilities installed on the system. For each installed DFS type, there is a line that begins with the file system type name (e.g., “nfs” or “autofs”), followed by descriptive text. /etc/dfs/dfstab: list of share commands to be executed at boot time /etc/dfs/sharetab: system record of shared file systems dfshares: lists available resources from remote or local systems For each resource, the fields are: resource server access transport Specify file sharing. sf4800a% more /etc/dfs/fstypes nfs NFS Utilities autofs AUTOFS Utilities cachefs CACHEFS Utilities sf4800a% more /etc/dfs/dfstab // since sf4800a is not a file server, it doesn’t have any file for sharing. To see these files, go to file server machine: sol10u6b as below!!! sol10u6b:/etc/dfs[190]cat dfstab # share -F nfs -o rw=engineering -d "home dirs" /export/home2 share -F nfs -o rw=.,nosuid /raid4 sol10u6b:/etc/dfs[191]cat sharetab //output file /raid4 - nfs rw=.,nosuid

Mounting remote resources mount [ -F nfs] [generic_options] [-o specific_options] [-O] resource mount_point mountall [-F FSType] [-l | -r] [file_system_table] The mount utility attaches a named resource to the file system hierarchy at the pathname location mount_point. /etc/vfstab: list of default parameters for each file system. Each entry consists of space-separated fields: device to mount, device to fsck, mount point, FS type, fsck pass, mount at boot, mount options. Those file systems with the mount-at-boot field “yes” are mounted automatically at boot time by mountall /etc/mnttab: a record of file systems that are currently mounted. Each entry consists of TAB-separated fields: special, mount_point, fstype, options, time Specify file mount operatoins. More /etc/vfstab // describe defaults of mounting fd - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c0t0d0s1 - - swap - no - /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no logging swap - /tmp tmpfs - yes -

Automounting automount [-t duration] [-v] Problem with static mounts If a client has many remote resources mounted, boot-time can be excessive Automount: Mount and unmount in response to client demand Automounter performs mount according to configuration files (/etc/auto_master, /etc/auto_home) When an empty mount point is referenced, OS sends a probe message to each server First reply wins: then uses the mount service to mount the filesystem at the first server to respond Attempt to unmount every 10 minutes Automounter (/usr/lib/autofs/automountd) is started at system boot-up time, and is a daemon process running at the client computer Man automount // automount is based on a config file auto_master (see below) Man mount_nfs Currently CSlab uses LDAP (Lightweight Directory Access Protocol) for file auto-mount (you may man ldap to see details). Ldap does auto-mount based on file auto_master, which points to two detailed config files: auto_home (for all files under /home) and auto_direct (for /var/mail and /public) You can view the contents of the files: ldaplist –l auto_master // it has two entries, one specifies auto_direct and the other for auto_home ldaplist –l auto_home ldaplist –l auto_direct The result of the auto-mount is shown in /etc/mnttab