Next Previous Contents

4. Ry8mizontas ton NFS client

Prwta 8a xreiasteite enan pyrhna me to NFS filesystem eite compiled mesa toy, h dia8esimo san module. Ayto kanonizetai prin kanete compile ston pyrhna. Ean pote den exete kanei compile enan pyrhna, pi8anon na xreiastei na diabasete kai na katanohsete to Kernel HOWTO. An xrhsimopoieite kapoia cool distribution (san thn RedHat) kai pote den anakateythkate me ton pyrhna, h me ta modules (kai ara den thn katastrecate ;-) ), to nfs polu pi8anon na einai aytomata dia8esimo.

Mporeite twra, sto root prompt, na dwsete mia katallhlh entolh mount, kai 8a emfanistei to filesystem. Synexizontas to paradeigma ths prohgoumenhs enothtas, 8eloyme na kanoyme mount to directory /mn/eris/local apo ton H/Y eris. Ayto ginetai me thn ejhs entolh :


mount -o rsize=1024,wsize=1024 eris:/mn/eris/local /mnt

(8a epistrecoyme stis parametroys rsize kai wsize.) To filesystem einai twra dia8esimo sto dir /mnt , kai mporeite na kanete cd s' ayto, kai meta ls , kai na deite ta arxeia ena-ena. 8a parathrhsete oti to nfs den einai toso grhgoro, oso ena topiko file system, alla einai polu bolikotero apo to ftp. Ean, anti na kanete epityxes mount sto filesystem, to mount dinei ena mhnyma la8oys, san ayto : mount: eris:/mn/eris/local failed, reason given by server: Permission denied , tote h to arxeio exports exei la8h, h jexasate na trejete to exportfs afou dior8wsate to arxeio exports. An to mhnyma leei : mount clntudp_create: RPC: Program not registered , ayto shmainei oti o nfsd h o mountd den trexoyne ston server. 'H, oti exete to problhma poy anaferame parapanw, me ta arxeia hosts.{allow,deny} .

Gia n' apallageite apo to filesystem, mporeite na dwsete :


umount /mnt

Gia na kanei o H/Y mount ena nfs filesystem me to bootarisma, dior8wste to /etc/fstab me ton synh8ismeno tropo. Sto paradeigma mas, apaiteitai mia grammh opws h parakatw :


# device      mountpoint     fs-type     options       dump fsckorder
...
eris:/mn/eris/local  /mnt    nfs        rsize=1024,wsize=1024 0    0
...

Sxedon teleiwsame. Omws, 8a parakalousa na synexisete to diabasma.

4.1 Epiloges sto mount

Yparxoyn merikes epiloges, poy prepei na skef8eite an 8a tis pros8esete. Aytes ry8mizoyn ton tropo, me ton opoio enas NFS client xeirizetai ena krasarisma toy server, h mia jafnikh ptwsh toy diktuoy. Ena apo ta omorfa pragmata sxetika me to NFS, einai oti mporei aneta na xeiristei tetoies katastaseis, an ry8misete swsta toys clients. Yparxoyn duo diaforetikoi tropoi xeirismou sfalmatos :

soft

O NFS client 8a dwsei mhnyma la8oys sth diergasia (process) poy paei na diabasei ena arxeio s' ena NFS filesystem. Merika programmata to xeirizontai ayto me cyxraimia, merika oxi. Den mporw na sas systhsw na xrhsimopoihsete th sygkekrimenh ru8mish, dioti einai syntagh gia na parete xalasmena arxeia kai xamena dedomena. Ayth th ru8mish prepei na thn apofeugete eidika se diskoys e-mail servers - ennow, an ektimate ta e-mails sas.

hard

To programma poy paei na diabasei ena arxeio se NFS filesystem, 8a kremasei, otan krasarei o server. H diergasia ayth den mporei na diakopei, h na ths kanete kill, ektos ki an epishs prosdiorisete to intr. Th stigmh poy o NFS server epanel8ei on-line, to programma 8a synexisei aperispasto apo ekei, opoy htan, kai pi8anotata ayto einai o,ti akribws epi8ymeite. Synistw na xrhsimopoieite hard,intr se ola ta NFS filesystems.

Synexizontas me to prohgoumeno paradeigma, h nea grammh sto fstab sas einai kapws etsi :


# device      mountpoint     fs-type    options    dump fsckorder
...
eris:/mn/eris/local  /mnt    nfs        rsize=1024,wsize=1024,hard,intr 0 0
...

4.2 Beltistopoiwntas to NFS

Synh8ws, an den ka8orizontai oi parametroi rsize kai wsize, to NFS diabazei kai grafei se kommatia twn 4096 h 8192 bytes. Merikoi syndyasmoi pyrhnwn Linux kai kartwn diktuoy den mporoun na xeiristoun toso megala kommatia, kai se kapoies periptwseis ayth mporei apla na mhn einai h beltisth ru8mish. Etsi, prepei na peiramatistoume, gia na broume ta rsize kai wsize poy doyleuoyne, kai einai ta taxutera dynata. Mporeite na dokimasete thn taxuthta twn ry8misewn sas me merikes aples entoles. Me dedomena thn parapanw entolh mount, kai to oti mporeite na gracete ston disko, mporeite na kanete to ejhs gia dokimh ths apodoshs seiriakhs eggrafhs :


time dd if=/dev/zero of=/mnt/testfile bs=16k count=4096

Ayto paragei ena arxeio 64MB me mhdenika bytes (arketa megalo, wste to krasarisma na mh syneisferei shmantika sthn apodosh poy metrame - xrhsimopoieiste megalutero arxeio, an exete pollh mnhmh). Epanalabete mia-dyo (5-10;) fores, kai bgalte ton meso oro twn xronwn. Edw mas endiaferei perissotero o "wrologiakos" xronos poy perase. Amesws meta, mporeite na dokimasete thn apodosh anagnwshs, diabazontas to idio arxeio :


time dd if=/mnt/testfile of=/dev/null bs=16k

Epanalabete kanadyo fores, kai bgalte meso oro. Meta kante umount, kai mount jana me megalutera rsize kai wsize. Pi8anotata prepei na einai pollaplasia toy 1024 kai oxi megalutera twn 16384 bytes, afou ayto einai to megisto mege8os sth version 2 toy NFS. Amesws meta to mount me megaluteres times, kante cd sto mounted filesystem, kai kante px ls. Ejereynhste ligaki to filesystem, gia na bebaiw8eite oti ola einai opws prepei. An ta rsize/wsize einai polu megala, ta symptwmata einai polu parajena, kai oxi 100% emfanh. Ena typiko sumptwma einai oi mh plhreis listes arxeiwn otan kanoyme ls, kai taytoxrona kanena mhnyma la8oys. 'H, na apotygxanei mysthriwdws h anagnwsh arxeiwn, pali xwris mhnyma la8oys. Afou bebaiw8eite oti ta sygkekrimena rsize/wsize doyleuoyn aproblhmatista, mporeite na janakanete tis dokimes taxuthtas. Oi diaforetikes platformes server einai pi8ano na exoyn diaforetikes beltistes times. To SunOS kai to Solaris fhmizontai oti einai polu taxutera me kommatia twn 4096 bytes, para me o,tidhpote allo.

Oi newteroi pyrhnes toy Linux (apo ton 1.3 kai meta) kanoyn proanagnwsh gia rsizes megalutera h isa me th "selida" mnhmhs toy H/Y. (Se CPUs ths Intel, to mege8os selidas mnhmhs einai 4096 bytes.) H proanagnwsh ayjanei shmantika thn apodosh anagnwshs toy NFS. Ara, se H/Y me CPU Intel, 8a xreiasteite - ean ayto, bebaia, einai dynaton - rsize twn 4096 bytes.

8ymh8eite na dior8wsete to /etc/fstab , wste na perasete mesa ta beltista rsize/wsize poy brhkate.

Ena kolpaki gia n' ayjhsete thn apodosh eggrafhs toy NFS, einai na apenergopoihsete tis sugxrones (synchronous) eggrafes ston server. Oi prodiagrafes toy NFS lene oti oi apaithseis gia kata NFS eggrafes den 8ewrountai teleiwmenes, prin ta eggrafomena dedomena bre8oun se meso poy ta krataei diarkws (synh8ws ton disko). Ayto periorizei kapws thn apodosh eggrafhs, ara oi asugxrones (asynchronous) eggrafes 8a epitaxunoyn ligaki th diadikasia ths kata NFS eggrafhs. O nfsd toy Linux den kanei sugxrones eggrafes, epeidh den toy to epitrepei to filesystem toy Linux. Omws, se servers poy den sthrizontai sto Linux, mporeite n' ayjhsete thn apodosh m' ayton ton tropo, eisagontas sto exports arxeio sas th grammh :


/dir    -async,access=linuxbox

h kapoia paromoia. Parakalw, diabaste thn tekmhriwsh (isws sth selida man;) toy H/Y sas gia to exports. Mono shmeiwste oti etsi ayjanetai kai o kindynos apwleias dedomenwn.


Next Previous Contents