中山大学软件学院操作系统概念上课课件第17章.ppt

上传人:asd****56 文档编号:87668947 上传时间:2023-04-16 格式:PPT 页数:29 大小:2.72MB
返回 下载 相关 举报
中山大学软件学院操作系统概念上课课件第17章.ppt_第1页
第1页 / 共29页
中山大学软件学院操作系统概念上课课件第17章.ppt_第2页
第2页 / 共29页
点击查看更多>>
资源描述

《中山大学软件学院操作系统概念上课课件第17章.ppt》由会员分享,可在线阅读,更多相关《中山大学软件学院操作系统概念上课课件第17章.ppt(29页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th Edition,Chapter 17:Distributed-File Systems17.2Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionChapter 17 Distributed-File SystemsnBackgroundnNaming and TransparencynRemote File Access nStateful versus Stateless S

2、ervicenFile ReplicationnAn Example:AFS17.3Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionChapter ObjectivesnTo explain the naming mechanism that provides location transparency and independencenTo describe the various methods for accessing distributed filesnTo contrast statefu

3、l and stateless distributed file serversnTo show how replication of files on different machines in a distributed file system is a useful redundancy for improving availabilitynTo introduce the Andrew file system(AFS)as an example of a distributed file system17.4Silberschatz,Galvin and Gagne 2009Opera

4、ting System Concepts 8th EditionBackgroundnDistributed file system(DFS)a distributed implementation of the classical time-sharing model of a file system,where multiple users share files and storage resourcesnA DFS manages set of dispersed storage devicesnOverall storage space managed by a DFS is com

5、posed of different,remotely located,smaller storage spacesnThere is usually a correspondence between constituent storage spaces and sets of files 17.5Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionDFS StructurenService software entity running on one or more machines and provi

6、ding a particular type of function to a priori unknown clientsnServer service software running on a single machinenClient process that can invoke a service using a set of operations that forms its client interfacenA client interface for a file service is formed by a set of primitive file operations(

7、create,delete,read,write)nClient interface of a DFS should be transparent,i.e.,not distinguish between local and remote files 17.6Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionNaming and TransparencynNaming mapping between logical and physical objectsnMultilevel mapping abst

8、raction of a file that hides the details of how and where on the disk the file is actually storednA transparent DFS hides the location where in the network the file is storednFor a file being replicated in several sites,the mapping returns a set of the locations of this files replicas;both the exist

9、ence of multiple copies and their location are hidden17.7Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionNaming Structures nLocation transparency file name does not reveal the files physical storage locationnLocation independence file name does not need to be changed when the

10、files physical storage location changes 17.8Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionNaming Schemes Three Main Approaches nFiles named by combination of their host name and local name;guarantees a unique system-wide namenAttach remote directories to local directories,gi

11、ving the appearance of a coherent directory tree;only previously mounted remote directories can be accessed transparentlynTotal integration of the component file systemslA single global name structure spans all the files in the systemlIf a server is unavailable,some arbitrary set of directories on d

12、ifferent machines also becomes unavailable 17.9Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionRemote File Access nRemote-service mechanism is one transfer approachnReduce network traffic by retaining recently accessed disk blocks in a cache,so that repeated accesses to the sa

13、me information can be handled locallylIf needed data not already cached,a copy of data is brought from the server to the userlAccesses are performed on the cached copylFiles identified with one master copy residing at the server machine,but copies of(parts of)the file are scattered in different cach

14、eslCache-consistency problem keeping the cached copies consistent with the master file4Could be called network virtual memory17.10Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionCache Location Disk vs.Main MemorynAdvantages of disk cacheslMore reliablelCached data kept on disk

15、 are still there during recovery and dont need to be fetched againnAdvantages of main-memory caches:lPermit workstations to be disklesslData can be accessed more quicklylPerformance speedup in bigger memorieslServer caches(used to speed up disk I/O)are in main memory regardless of where user caches

16、are located;using main-memory caches on the user machine permits a single caching mechanism for servers and users 17.11Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionCache Update PolicynWrite-through write data through to disk as soon as they are placed on any cachelReliable,

17、but poor performancenDelayed-write modifications written to the cache and then written through to the server laterl Write accesses complete quickly;some data may be overwritten before they are written back,and so need never be written at alllPoor reliability;unwritten data will be lost whenever a us

18、er machine crasheslVariation scan cache at regular intervals and flush blocks that have been modified since the last scanlVariation write-on-close,writes data back to the server when the file is closed4Best for files that are open for long periods and frequently modified17.12Silberschatz,Galvin and

19、Gagne 2009Operating System Concepts 8th EditionCacheFS and its Use of Caching17.13Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionConsistencynIs locally cached copy of the data consistent with the master copy?nClient-initiated approachlClient initiates a validity checklServer

20、checks whether the local data are consistent with the master copynServer-initiated approachlServer records,for each client,the(parts of)files it caches lWhen server detects a potential inconsistency,it must react 17.14Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionComparing C

21、aching and Remote ServicenIn caching,many remote accesses handled efficiently by the local cache;most remote accesses will be served as fast as local onesnServers are contracted only occasionally in caching(rather than for each access)lReduces server load and network trafficlEnhances potential for s

22、calabilitynRemote server method handles every remote access across the network;penalty in network traffic,server load,and performancenTotal network overhead in transmitting big chunks of data(caching)is lower than a series of responses to specific requests(remote-service)17.15Silberschatz,Galvin and

23、 Gagne 2009Operating System Concepts 8th EditionCaching and Remote Service(Cont.)nCaching is superior in access patterns with infrequent writeslWith frequent writes,substantial overhead incurred to overcome cache-consistency problemnBenefit from caching when execution carried out on machines with ei

24、ther local disks or large main memoriesnRemote access on diskless,small-memory-capacity machines should be done through remote-service methodnIn caching,the lower intermachine interface is different form the upper user interfacenIn remote-service,the intermachine interface mirrors the local user-fil

25、e-system interface17.16Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionStateful File ServicenMechanismlClient opens a filelServer fetches information about the file from its disk,stores it in its memory,and gives the client a connection identifier unique to the client and the

26、open file lIdentifier is used for subsequent accesses until the session endslServer must reclaim the main-memory space used by clients who are no longer activenIncreased performancelFewer disk accesseslStateful server knows if a file was opened for sequential access and can thus read ahead the next

27、blocks17.17Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionStateless File ServernAvoids state information by making each request self-containednEach request identifies the file and position in the filenNo need to establish and terminate a connection by open and close operation

28、s17.18Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionDistinctions Between Stateful andStateless Service nFailure RecoverylA stateful server loses all its volatile state in a crash4Restore state by recovery protocol based on a dialog with clients,or abort operations that were

29、underway when the crash occurred4Server needs to be aware of client failures in order to reclaim space allocated to record the state of crashed client processes(orphan detection and elimination)lWith stateless server,the effects of server failure sand recovery are almost unnoticeable4A newly reincar

30、nated server can respond to a self-contained request without any difficulty17.19Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionDistinctions(Cont.)nPenalties for using the robust stateless service:llonger request messageslslower request processing ladditional constraints impos

31、ed on DFS designnSome environments require stateful servicelA server employing server-initiated cache validation cannot provide stateless service,since it maintains a record of which files are cached by which clientslUNIX use of file descriptors and implicit offsets is inherently stateful;servers mu

32、st maintain tables to map the file descriptors to inodes,and store the current offset within a file17.20Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionFile ReplicationnReplicas of the same file reside on failure-independent machinesnImproves availability and can shorten servi

33、ce timenNaming scheme maps a replicated file name to a particular replicalExistence of replicas should be invisible to higher levels lReplicas must be distinguished from one another by different lower-level namesnUpdates replicas of a file denote the same logical entity,and thus an update to any rep

34、lica must be reflected on all other replicasnDemand replication reading a nonlocal replica causes it to be cached locally,thereby generating a new nonprimary replica 17.21Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionAn Example:AFSnA distributed computing environment(Andrew)

35、under development since 1983 at Carnegie-Mellon University,purchased by IBM and released as Transarc DFS,now open sourced as OpenAFSnAFS tries to solve complex issues such as uniform name space,location-independent file sharing,client-side caching(with cache consistency),secure authentication(via Ke

36、rberos)lAlso includes server-side caching(via replicas),high availabilitylCan span 5,000 workstations17.22Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW(Cont.)nClients are presented with a partitioned space of file names:a local name space and a shared name spacenDedic

37、ated servers,called Vice,present the shared name space to the clients as an homogeneous,identical,and location transparent file hierarchynThe local name space is the root file system of a workstation,from which the shared name space descendsnWorkstations run the Virtue protocol to communicate with V

38、ice,and are required to have local disks where they store their local name spacenServers collectively are responsible for the storage and management of the shared name space17.23Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW(Cont.)nClients and servers are structured in

39、 clusters interconnected by a backbone LANnA cluster consists of a collection of workstations and a cluster server and is connected to the backbone by a routernA key mechanism selected for remote file operations is whole file cachinglOpening a file causes it to be cached,in its entirety,on the local

40、 disk17.24Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW Shared Name SpacenAndrews volumes are small component units associated with the files of a single clientnA fid identifies a Vice file or directory-A fid is 96 bits long and has three equal-length components:lvolu

41、me numberlvnode number index into an array containing the inodes of files in a single volumeluniquifier allows reuse of vnode numbers,thereby keeping certain data structures,compactnFids are location transparent;therefore,file movements from server to server do not invalidate cached directory conten

42、ts nLocation information is kept on a volume basis,and the information is replicated on each server17.25Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW File OperationsnAndrew caches entire files form serverslA client workstation interacts with Vice servers only during o

43、pening and closing of filesnVenus caches files from Vice when they are opened,and stores modified copies of files back when they are closednReading and writing bytes of a file are done by the kernel without Venus intervention on the cached copynVenus caches contents of directories and symbolic links

44、,for path-name translationnExceptions to the caching policy are modifications to directories that are made directly on the server responsibility for that directory17.26Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW ImplementationnClient processes are interfaced to a UN

45、IX kernel with the usual set of system callsnVenus carries out path-name translation component by componentnThe UNIX file system is used as a low-level storage system for both servers and clientslThe client cache is a local directory on the workstations disknBoth Venus and server processes access UN

46、IX files directly by their inodes to avoid the expensive path name-to-inode translation routine17.27Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionANDREW Implementation(Cont.)nVenus manages two separate caches:lone for statuslone for datanLRU algorithm used to keep each of th

47、em bounded in sizenThe status cache is kept in virtual memory to allow rapid servicing of stat()(file status returning)system callsnThe data cache is resident on the local disk,but the UNIX I/O buffering mechanism does some caching of the disk blocks in memory that are transparent to VenusSilberschatz,Galvin and Gagne 2009Operating System Concepts 8th Edition,End of Chapter 1717.29Silberschatz,Galvin and Gagne 2009Operating System Concepts 8th EditionFig.17.01

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 技术资料 > 其他杂项

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁