Distriuted Systems Priniples nd Prdigms Christoph Dorn Distriuted Systems Group, Vienn University of Tehnology.dorn@infosys.tuwien..t http://www.infosys.tuwien..t/stff/dorn Slides dpted from Mrten vn Steen, VU Amsterdm, steen@s.vu.nl Chpter 11: Distriuted File Systems
Contents Chpter 01: Introdution 02: Arhitetures 03: Proesses 04: Communition 05: Nming 06: Synhroniztion 07: Consisteny & Replition 08: Fult Tolerne 09: Seurity 10: Distriuted Ojet-Bsed Systems 11: Distriuted File Systems 12: Distriuted We-Bsed Systems 13: Distriuted Coordintion-Bsed Systems DS WS 2014 2 / 14
Distriuted File Systems Generl gol Try to mke file system trnsprently ville to remote lients. 1. File moved to lient Old file New file Requests from lient to ess remote file File stys on server Remote ess model 2. Aesses re done on lient 3. When lient is done, file is returned to Uplod/downlod model DS WS 2014 3 / 14
NFS Exmple: NFS Arhiteture NFS is implemented using the Virtul File System strtion, whih is now used for lots of different operting systems. System ll lyer System ll lyer Virtul file system (VFS) lyer Virtul file system (VFS) lyer Lol file system interfe NFS lient NFS server Lol file system interfe RPC lient stu RPC server stu Network DS WS 2014 4 / 14
Exmple: NFS Arhiteture Essene VFS provides stndrd file system interfe, nd llows to hide differene etween essing lol or remote file system. Question Is NFS tully file system? DS WS 2014 5 / 14
NFS File Opertions Oper. v3 v4 Desription Crete Yes No Crete regulr file Crete No Yes Crete nonregulr file Link Yes Yes Crete hrd link to file Symlink Yes No Crete symoli link to file Mkdir Yes No Crete sudiretory Mknod Yes No Crete speil file Renme Yes Yes Chnge the nme of file Remove Yes Yes Remove file from file system Rmdir Yes No Remove n empty sudiretory Open No Yes Open file Close No Yes Close file Lookup Yes Yes Look up file y mens of nme Reddir Yes Yes Red the entries in diretory Redlink Yes Yes Red the pth nme in symoli link Getttr Yes Yes Get the ttriute vlues for file Setttr Yes Yes Set one or more file-ttriute vlues Red Yes Yes Red the dt ontined in file Write Yes Yes Write dt to file DS WS 2014 6 / 14
Cluster-Bsed File Systems Oservtion With very lrge dt olletions, following simple lient-server pproh is not going to work for speeding up file esses, pply striping tehniques y whih files n e fethed in prllel. File lok of file File lok of file e d e d e d e Whole-file distriution e d d d e e DS WS 2014 File-striped 7 / 14 system
GFS lient Exmple: Google File System file nme, hunk index Mster ontt ddress Instrutions Chunk-server stte Chunk ID, rnge Chunk dt Chunk server Linux file system Chunk server Linux file system Chunk server Linux file system The Google solution Divide files in lrge 64 MB hunks, nd distriute/replite hunks ross mny servers: The mster mintins only (file nme, hunk server) tle in min memory miniml I/O Files re replited using primry-kup sheme; the mster is kept out of the loop DS WS 2014 8 / 14
Prolem When deling with distriuted file systems, we need to tke into ount the ordering of onurrent red/write opertions nd expeted semntis (i.e., onsisteny). Single mhine Originl file File shring semntis mhine #1 Proess A 2. Write "" File server 1. Red "" Proess A 3. Red gets "" mhine #2 Proess B Proess B 1. Write "" 2. Red gets "" () DS WS 2014 9 / 14 ()
File shring semntis Semntis UNIX semntis: red opertion returns the effet of the lst write opertion n only e implemented for remote ess models in whih there is only single opy of the file Trnstion semntis: the file system supports trnstions on single file issue is how to llow onurrent ess to physilly distriuted file Session semntis: the effets of red nd write opertions re seen only y the lient tht hs opened ( lol opy) of the file wht hppens when file is losed (only one lient my tully win) DS WS 2014 10 / 14
Essene Exmple: File shring in Cod Cod ssumes trnstionl semntis, ut without the full-fledged pilities of rel trnstions. Note: Trnstionl issues repper in the form of this ordering ould hve tken ple. Session S A Open(RD) File f Invlidte Close Open(WR) File f Close Session S B Time DS WS 2014 11 / 14
Consisteny nd replition Oservtion In modern distriuted file systems, lient-side hing is the preferred tehnique for ttining performne; server-side replition is done for fult tolerne. Oservtion s re llowed to keep (lrge prts of) file, nd will e notified when ontrol is withdrwn servers re now generlly stteful 1. sks for file 2. delegtes file Old file Lol opy 3. rells delegtion 4. sends returns file Updted file DS WS 2014 12 / 14
Exmple: -side hing in Cod A Session S A Session SA Open(RD) File f Invlidte (llk rek) Close Open(RD) File f Close File f OK (no file trnsfer) Open(WR) Open(WR) Close Close B Session S B Session S B Time Note By mking use of trnstionl semntis, it eomes possile to further improve performne. DS WS 2014 13 / 14
Exmple: -side replition in Cod S 1 S 3 A S 2 Broken network B Min issue Ensure tht onurrent updtes re deteted: Eh lient hs n Aessile Volume Storge Group (AVSG): is suset of the tul VSG. Version vetor CVV i (f )[j] = k S i knows tht S j hs seen version k of f. Exmple: A updtes f S 1 = S 2 = [+1,+1,+0]; B updtes f S 3 = [+0,+0,+1]. DS WS 2014 14 / 14