Distriut Systms Prinipls n Prigms Mrtn vn Stn VU mstrm, Dpt. Computr Sin stn@s.vu.nl Chptr 11: Vrsion: Dmr 10, 2012 1 / 14 Gnrl gol Try to mk fil systm trnsprntly vill to rmot lints. 1. Fil mov to lint Ol fil Nw fil Rqusts from lint to ss rmot fil Fil stys on srvr Rmot ss mol 2. sss r on on lint 3. Whn lint is on, fil is rturn to Uplo/ownlo mol 2 / 14 2 / 14 Exmpl: NFS rhittur NFS NFS is implmnt using th Virtul Fil Systm strtion, whih is now us for lots of iffrnt oprting systms. Systm ll lyr Systm ll lyr Virtul fil systm (VFS) lyr Virtul fil systm (VFS) lyr Lol fil systm intrf NFS lint NFS srvr Lol fil systm intrf RPC lint stu RPC srvr stu Ntwork 3 / 14 3 / 14
Exmpl: NFS rhittur Essn VFS provis stnr fil systm intrf, n llows to hi iffrn twn ssing lol or rmot fil systm. Qustion Is NFS tully fil systm? 4 / 14 4 / 14 NFS Fil Oprtions Opr. v3 v4 Dsription Crt Ys No Crt rgulr fil Crt No Ys Crt nonrgulr fil Link Ys Ys Crt hr link to fil Symlink Ys No Crt symoli link to fil Mkir Ys No Crt suirtory Mkno Ys No Crt spil fil Rnm Ys Ys Chng th nm of fil Rmov Ys Ys Rmov fil from fil systm Rmir Ys No Rmov n mpty suirtory Opn No Ys Opn fil Clos No Ys Clos fil Lookup Ys Ys Look up fil y mns of nm Rir Ys Ys R th ntris in irtory Rlink Ys Ys R th pth nm in symoli link Gtttr Ys Ys Gt th ttriut vlus for fil Stttr Ys Ys St on or mor fil-ttriut vlus R Ys Ys R th t ontin in fil Writ Ys Ys Writ t to fil 5 / 14 5 / 14 Clustr-s Fil Systms Osrvtion With vry lrg t olltions, following simpl lint-srvr pproh is not going to work for sping up fil sss, pply striping thniqus y whih fils n fth in prlll. Fil lok of fil Fil lok of fil Whol-fil istriution Fil-strip systm 6 / 14 6 / 14
Exmpl: Googl Fil Systm GFS lint fil nm, hunk inx ontt rss Mstr Instrutions Chunk-srvr stt Chunk ID, rng Chunk t Chunk srvr Linux fil systm Chunk srvr Linux fil systm Chunk srvr Linux fil systm Th Googl solution Divi fils in lrg 64 M hunks, n istriut/rplit hunks ross mny srvrs: Th mstr mintins only (fil nm, hunk srvr) tl in min mmory miniml I/O Fils r rplit using primry-kup shm; th mstr is kpt out of th loop 7 / 14 7 / 14 P2P-s Fil Systms Fil systm lyr No whr fil systm is root lok-orint storg DHsh DHsh DHsh DHT lyr Chor Chor Chor Ntwork si i Stor t loks in th unrlying P2P systm: Evry t lok with ontnt D is stor on no with hsh h(d). llows for intgrity hk. Puli-ky loks r sign with ssoit privt ky n look up with puli ky. lol log of fil oprtions to kp trk of lokid,h(d) pirs. 8 / 14 8 / 14 11.5 Synhroniztion 11.5 Synhroniztion Fil shring smntis Prolm mhin #1 Whn ling with istriut fil systms, w n to tk into ount th orring of onurrnt r/writ oprtions n xpt smntis (i.., onsistny). Singl mhin Originl fil Pross 2. Writ "" Fil srvr 1. R "" Pross 3. R gts "" mhin #2 Pross Pross 1. Writ "" 2. R gts "" () () 9 / 14 9 / 14
11.5 Synhroniztion 11.5 Synhroniztion Fil shring smntis Smntis UNIX smntis: r oprtion rturns th fft of th lst writ oprtion n only implmnt for rmot ss mols in whih thr is only singl opy of th fil Trnstion smntis: th fil systm supports trnstions on singl fil issu is how to llow onurrnt ss to physilly istriut fil Sssion smntis: th ffts of r n writ oprtions r sn only y th lint tht hs opn ( lol opy) of th fil wht hppns whn fil is los (only on lint my tully win) 10 / 14 10 / 14 Exmpl: Fil shring in Co 11.5 Synhroniztion 11.5 Synhroniztion Essn Co ssums trnstionl smntis, ut without th full-flg pilitis of rl trnstions. Not: Trnstionl issus rppr in th form of this orring oul hv tkn pl. Sssion S Opn(RD) Fil f Invlit Clos Opn(WR) Fil f Clos Sssion S Tim 11 / 14 11 / 14 Consistny n rplition 11.6 Consistny n Rplition 11.6 Consistny n Rplition Osrvtion In morn istriut fil systms, lint-si hing is th prfrr thniqu for ttining prformn; srvr-si rplition is on for fult tolrn. Osrvtion s r llow to kp (lrg prts of) fil, n will notifi whn ontrol is withrwn srvrs r now gnrlly sttful 1. sks for fil 2. lgts fil Ol fil Lol opy 3. rlls lgtion 4. sns rturns fil Upt fil 12 / 14 12 / 14
11.6 Consistny n Rplition Exmpl: -si hing in Co 11.6 Consistny n Rplition Sssion S Sssion S Opn(RD) Fil f Invlit (llk rk) Clos Opn(RD) Fil f Clos Fil f OK (no fil trnsfr) Opn(WR) Opn(WR) Clos Clos Sssion S Sssion S Tim Not y mking us of trnstionl smntis, it oms possil to furthr improv prformn. 13 / 14 13 / 14 11.6 Consistny n Rplition Exmpl: -si rplition in Co 11.6 Consistny n Rplition S 1 S 3 S 2 rokn ntwork Min issu Ensur tht onurrnt upts r tt: Eh lint hs n ssil Volum Storg Group (VSG): is sust of th tul VSG. Vrsion vtor CVV i (f )[j] = k S i knows tht S j hs sn vrsion k of f. Exmpl: upts f S 1 = S 2 = [+1,+1,+0]; upts f S 3 = [+0,+0,+1]. 14 / 14 14 / 14