1. Trang chủ
  2. » Giáo án - Bài giảng

tính toán song song thoại nam distributedsystem 16 fileservice sinhvienzone com

28 28 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 28
Dung lượng 630,03 KB

Nội dung

Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley 2001 Distributed Systems Course Viewing: These slides must be viewed in slide show mode nh Vi en Zo Chapter Revision: Failure model Chapter 8: 8.1 8.2 8.3 [8.4 8.5 8.6 Si Copyright © George Coulouris, Jean Dollimore, Tim Kindberg 2001 email: authors@cdk2.net This material is made available for private study and for direct use by individual teachers It may not be included in any product or employed in any service without the written permission of the authors ne C om Distributed File Systems SinhVienZone.com Introduction File service architecture Sun Network File System (NFS) Andrew File System (personal study)] Recent advances Summary https://fb.com/sinhvienzonevn om Learning objectives ne C  Understand the requirements that affect the design of distributed services nh Vi en Obtain a knowledge of file systems, both local and networked Caching as an essential design technique Remote interfaces are not the same as APIs Security requires special consideration Si – – – – Zo  NFS: understand how a relatively simple, widelyused service is designed  Recent advances: appreciate the ongoing research that often leads to major advances SinhVienZone.com https://fb.com/sinhvienzonevn Chapter Revision: Failure model Description Process halts and remains halted Other processes may detect this state Crash Process Process halts and remains halted Other processes may not be able to detect this state Omission Channel A message inserted in an outgoing message buffer never arrives at the other end’s incoming message buffer Send-omission Process A process completes a send, but the message is not put in its outgoing message buffer Receive-omission Process A message is put in a process’s incoming message buffer, but that process does not receive it Arbitrary Process Process/channel exhibits arbitrary behaviour: it may (Byzantine) or channel send/transmit arbitrary messages at arbitrary times, commit omissions; a process may stop or take an incorrect step .C Affects Process Si nh Vi en Zo ne Class of failure Fail-stop om Figure 2.11 SinhVienZone.com https://fb.com/sinhvienzonevn om Storage systems and their properties ne C  In first generation of distributed systems (1974-95), file systems (e.g NFS) were the only networked storage systems Si nh Vi en Zo  With the advent of distributed object systems (CORBA, Java) and the web, the picture has become more complex SinhVienZone.com https://fb.com/sinhvienzonevn Storage systems and their properties om Types of consistency between copies: - strict one-copy consistency √ - approximate consistency X - no automatic consistency C Figure 8.1 ne Sharing Persis- Distributed Consistency Example tence cache/replicas maintenance File system Distributed file system Web RAM UNIX file system Sun NFS Web server Ivy (Ch 16) Si Distributed shared memory nh Vi en Zo Main memory Remote objects (RMI/ORB) CORBA Persistent object store CORBA Persistent Object Service Persistent distributed object store SinhVienZone.com PerDiS, Khazana https://fb.com/sinhvienzonevn What is a file system? om  Persistent stored data sets C  Hierarchic name space visible to all processes ne  API with the following characteristics: Zo – access and update operations on persistently stored data sets – Sequential access model (with additional random facilities) nh Vi en  Sharing of data between users, with access control  Concurrent access: – certainly for read-only access – what about updates? Si  Other features: – mountable file stores – more? SinhVienZone.com https://fb.com/sinhvienzonevn * om What is a file system? ne nh Vi en status = close(filedes) count = read(filedes, buffer, n) count = write(filedes, buffer, n) 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 Closes the open file filedes 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 Moves the read-write pointer to offset (relative or absolute, depending on whence) Removes the file name from the directory structure If the file has no other names, it is deleted Adds a new name (name2) for a file (name1) Gets the file attributes for file name into buffer Zo filedes = open(name, mode) filedes = creat(name, mode) C Figure 8.4 UNIX file system operations Si pos = lseek(filedes, offset, whence) status = unlink(name) status = link(name1, name2) status = stat(name, buffer) SinhVienZone.com https://fb.com/sinhvienzonevn * om What is a file system? Figure 8.3 File attribute record structure ne C File length Creation timestamp updated by system: nh Vi en Zo Read timestamp Write timestamp updated by owner: Si Attribute timestamp Reference count Owner File type Access control list E.g for UNIX: rw-rw-r-SinhVienZone.com https://fb.com/sinhvienzonevn * File service requirements  Heterogeneity  Fault tolerance  Consistency  Efficiency om C Si  Security ne  Replication Zo  Concurrency Tranparencies Concurrency properties Replication properties Heterogeneity Access: Sameproperties operations Fault tolerance Consistency Isolation Security File service maintains multiple identical copies of Efficiency Service can be accessed by clients running on Location: Same name space after relocation of Service must continue tocontrol operate even when Unix offers one-copy update semantics for asclients File-level or record-level locking files Must maintain access and privacy (almost) any OS or hardware platform Goal for distributed file systems is usually for files or processes make errors or crash operations on local files - caching is completely local files Other forms of concurrency control to minimise • Load-sharing between servers makes service performance comparable tothe local file system Design must be compatible with file systems of Mobility: Automatic relocation of files is possible transparent •more at-most-once semantics •based on identity of user making request contention scalable different OSes Performance: Satisfactory performance across a Difficult to achieve the same for distributed file • at-least-once semantics •identities of remote users must be authenticated • Service Local access has better response (lower latency) specified rangebe of open system loads interfaces must - precise systems while maintaining good performance •requires idempotent operations •privacy requires secure communication • Fault specifications APIs published Scaling: Service of can be are expanded to meet andtolerance scalability Service must resume after a server machine not interfaces are open to all processes additional loads FullService replication is difficult to implement crashes excluded by a firewall Caching (of all or part of a file) gives most of the If the service is replicated, it can continue impersonation andto other benefits •vulnerable (except faulttotolerance) operate even during a server crash attacks nh Vi en  Transparency SinhVienZone.com 10 https://fb.com/sinhvienzonevn * Model file service architecture Figure 8.5 om Lookup AddName UnName GetNames ne Server computer Directory service Zo nh Vi en Application Application program program C Client computer Flat file service Si Client module SinhVienZone.com Read Write Create Delete GetAttributes SetAttributes 11 https://fb.com/sinhvienzonevn NFS architecture Client computer om Figure 8.8 NFS Application program Client Application Application program program Operations on local files ne Operations on remote files NFS client Virtual file system NFS server NFS Client Si UNIX file system nh Vi en Virtual file system Other file system UNIX kernel Application program Kernel Zo UNIX system calls Server computer C Client computer UNIX file system NFS protocol (remote operations) SinhVienZone.com 15 https://fb.com/sinhvienzonevn * om NFS architecture: does the implementation have to be in the system kernel? No: Zo ne C – there are examples of NFS clients and servers that run at applicationlevel as libraries or processes (e.g early Windows and MacOS implementations, current PocketPC, etc.) nh Vi en But, for a Unix implementation there are advantages: – Binary code compatible - no need to recompile applications  Standard system calls that access remote files can be routed through the NFS client module by the kernel Si – Shared cache of recently-used blocks at client – Kernel-level server can access i-nodes and file blocks directly  but a privileged (root) application program could almost the same – Security of the encryption key used for authentication SinhVienZone.com 16 https://fb.com/sinhvienzonevn * NFS server operations (simplified) nh Vi en Zo ne C fh = fileModel handle:flat file service read(fh, offset, count) -> attr, data Read(FileId, i, n) -> Data write(fh, offset, count, data) -> attr identifier i-node number i-node generation Write(FileId, i, Data) create(dirfh, name, attr) -> newfh, attr Filesystem Create() -> FileId remove(dirfh, name) status Delete(FileId) getattr(fh) -> attr GetAttributes(FileId) -> Attr setattr(fh, attr) -> attr SetAttributes(FileId, Attr) lookup(dirfh, name) -> fh, attr rename(dirfh, name, todirfh, toname) Model directory service link(newdirfh, newname, dirfh, name) Lookup(Dir, Name) -> FileId readdir(dirfh, cookie, count) -> entries AddName(Dir, Name, File) symlink(newdirfh, newname, string) -> statusUnName(Dir, Name) readlink(fh) -> string GetNames(Dir, Pattern) mkdir(dirfh, name, attr) -> newfh, attr ->NameSeq rmdir(dirfh, name) -> status statfs(fh) -> fsstats Si • • • • • • • • • • • • • • • om Figure 8.9 SinhVienZone.com 17 https://fb.com/sinhvienzonevn * om NFS access control and authentication C  Stateless server, so the user's identity and access rights must be checked by the server on each request ne – In the local file system they are checked only on open() Zo  Every client request is accompanied by the userID and groupID nh Vi en – not shown in the Figure 8.9 because they are inserted by the RPC system  Server is exposed to imposter attacks unless the userID and groupID are protected by encryption Si  Kerberos has been integrated with NFS to provide a stronger and more comprehensive security solution – Kerberos is described in Chapter Integration of NFS with Kerberos is covered later in this chapter SinhVienZone.com 18 https://fb.com/sinhvienzonevn * om Mount service ne C  Mount operation: mount(remotehost, remotedirectory, localdirectory) nh Vi en Zo  Server maintains a table of clients who have mounted filesystems at that server Si  Each client maintains a table of mounted file systems holding: < IP address, port number, file handle>  Hard versus soft mounts SinhVienZone.com 19 https://fb.com/sinhvienzonevn * Local and remote file systems accessible on an NFS client Client (root) (root) usr nfs Remote people mount students Remote x Si big jon bob vmunix nh Vi en export Zo ne (root) Server C Server om Figure 8.10 staff mount users jim ann jane joe 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 SinhVienZone.com 20 https://fb.com/sinhvienzonevn * om NFS optimization - server caching  Similar to UNIX file caching for local files: nh Vi en Zo ne C – pages (blocks) from disk are held in a main memory buffer cache until the space is required for newer pages Read-ahead and delayed-write optimizations – For local files, writes are deferred to next sync event (30 second intervals) – Works well in local context, where files are always accessed through the local cache, but in the remote case it doesn't offer necessary synchronization guarantees to clients  NFS v3 servers offers two strategies for updating the disk: Si – write-through - altered pages are written to disk as soon as they are received at the server When a write() RPC returns, the NFS client knows that the page is on the disk – delayed commit - pages are held only in the cache until a commit() call is received for the relevant file This is the default mode used by NFS v3 clients A commit() is issued by the client whenever a file is closed SinhVienZone.com 23 https://fb.com/sinhvienzonevn * om NFS optimization - client caching C  Server caching does nothing to reduce RPC traffic between client and server ne – further optimization is essential to reduce server load in large networks nh Vi en Zo – NFS client module caches the results of read, write, getattr, lookup and readdir operations – synchronization of file contents (one-copy semantics) is not guaranteed when two or more clients are sharing the same file  Timestamp-based validity check Si – reduces inconsistency, but doesn't eliminate it – validity condition for cache entries at the client: (T - Tc < t) v (Tmclient = Tmserver) – t is configurable (per file) but is typically set to seconds for files and 30 secs for directories – it remains difficult to write distributed applications that share files with NFS SinhVienZone.com 24 t Tc freshness guarantee time when cache entry was last validated Tm time when block was last updated at server T current time https://fb.com/sinhvienzonevn * om Other NFS optimizations  Sun RPC runs over UDP by default (can use TCP if required) ne C  Uses UNIX BSD Fast File System with 8-kbyte blocks Zo  reads() and writes() can be of any size (negotiated between client and server) nh Vi en  the guaranteed freshness interval t is set adaptively for individual files to reduce gettattr() calls needed to update Tm Si  file attribute information (including Tm) is piggybacked in replies to all file requests SinhVienZone.com 25 https://fb.com/sinhvienzonevn * NFS summary C om  An excellent example of a simple, robust, high-performance distributed service ne  Achievement of transparencies (See section 1.4.7): Zo Access: Excellent; the API is the UNIX system call interface for both local and remote files nh Vi en Location: Not guaranteed but normally achieved; naming of filesystems is controlled by client mount operations, but transparency can be ensured by an appropriate system configuration Si Concurrency: Limited but adequate for most purposes; when read-write files are shared concurrently between clients, consistency is not perfect Replication: Limited to read-only file systems; for writable files, the SUN Network Information Service (NIS) runs over NFS and is used to replicate essential system files, see Chapter 14 SinhVienZone.com 27 https://fb.com/sinhvienzonevn cont'd * NFS summary om Achievement of transparencies (continued): ne C Failure: Limited but effective; service is suspended if a server fails Recovery from failures is aided by the simple stateless design Mobility: Hardly achieved; relocation of files is not possible, relocation of Zo filesystems is possible, but requires updates to client configurations nh Vi en Performance: Good; multiprocessor servers achieve very high performance, but for a single filesystem it's not possible to go beyond the throughput of a multiprocessor server Si Scaling: Good; filesystems (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) SinhVienZone.com 28 https://fb.com/sinhvienzonevn * om Recent advances in file services NFS enhancements nh Vi en Zo ne C WebNFS - NFS server implements a web-like service on a well-known port Requests use a 'public file handle' and a pathname-capable variant of lookup() Enables applications to access NFS servers directly, e.g to read a portion of a large file One-copy update semantics (Spritely NFS, NQNFS) - Include an open() operation and maintain tables of open files at servers, which are used to prevent multiple writers and to generate callbacks to clients notifying them of updates Performance was improved by reduction in gettattr() traffic Improvements in disk storage organisation Si RAID - improves performance and reliability by striping data redundantly across several disk drives Log-structured file storage - updated pages are stored contiguously in memory and committed to disk in large contiguous blocks (~ Mbyte) File maps are modified whenever an update occurs Garbage collection to recover disk space SinhVienZone.com 34 https://fb.com/sinhvienzonevn * om New design approaches Distribute file data across several servers Zo 'Serverless' architecture ne C – Exploits high-speed networks (ATM, Gigabit Ethernet) – Layered approach, lowest level is like a 'distributed virtual disk' – Achieves scalability even for a single heavily-used file nh Vi en – Exploits processing and disk resources in all available network nodes – Service is distributed at the level of individual files Examples: Si xFS (section 8.5): Experimental implementation demonstrated a substantial performance gain over NFS and AFS Frangipani (section 8.5): Performance similar to local UNIX file access Tiger Video File System (see Chapter 15) Peer-to-peer systems: Napster, OceanStore (UCB), Farsite (MSR), Publius (AT&T research) - see web for documentation on these very recent systems SinhVienZone.com 35 https://fb.com/sinhvienzonevn * om New design approaches  Replicated read-write files ne C – High availability – Disconnected working Zo  re-integration after disconnection is a major problem if conflicting updates have ocurred nh Vi en – Examples: Si  Bayou system (Section 14.4.2)  Coda system (Section 14.4.3) SinhVienZone.com 36 https://fb.com/sinhvienzonevn * om Summary C  Sun NFS is an excellent example of a distributed service designed to meet many important design requirements Zo ne  Effective client caching can produce file service performance equal to or better than local file systems nh Vi en  Consistency versus update semantics versus fault tolerance remains an issue  Most client and server failures can be masked Si  Future Superior scalability can be achieved with whole-file serving requirements: – support for mobile disconnected operation, automatic re-integration (Andrew FS) or theusers, distributed virtual disk approach (Cf Coda file system, Chapter 14) – support for data streaming and quality of service (Cf Tiger file system, Chapter 15) SinhVienZone.com 37 https://fb.com/sinhvienzonevn * ... attacks nh Vi en  Transparency SinhVienZone. com 10 https://fb .com/ sinhvienzonevn * Model file service architecture Figure 8.5 om Lookup AddName UnName GetNames ne Server computer Directory service... SetAttributes(FileId, Attr) SinhVienZone. com Zo position of first byte Write(FileId, i, Data) Lookup(Dir, Name) -> FileId FileId AddName(Dir, Name, File) ne Read(FileId, i, n) -> Data UnName(Dir, Name) GetNames(Dir,... lookup(dirfh, name) -> fh, attr rename(dirfh, name, todirfh, toname) Model directory service link(newdirfh, newname, dirfh, name) Lookup(Dir, Name) -> FileId readdir(dirfh, cookie, count) -> entries AddName(Dir,

Ngày đăng: 30/01/2020, 22:29