Yuav luag txhua hom Linux muaj peev xwm teeb tsa Network File System (NFS) uas tso cai rau Linux khoos phis tawj ntawm tib lub network sib qhia cov ntaub ntawv. Txawm hais tias NFS tsuas yog haum rau cov tes hauj lwm suav nrog cov khoos phis tawj thiab Linux servers, nws ua haujlwm nyob rau theem txheej txheem kom nrawm thiab siv tau cov ntaub ntawv hloov pauv ntawm cov khoos phis tawj.
Kauj ruam
Ntu 1 ntawm 2: Tsim Tus Server
Kauj Ruam 1. Siv NFS los faib cov ntaub ntawv ntawm Linux khoos phis tawj hauv lub network
Yog tias koj xav qhia cov ntaub ntawv nrog Mac lossis Windows khoos phis tawj, siv Samba.
Kauj Ruam 2. Paub tias NFS ua haujlwm li cas
Thaum faib cov ntaub ntawv siv NFS, muaj ob tog: tus neeg rau zaub mov thiab tus neeg siv khoom. Tus neeg rau zaub mov yog lub khoos phis tawj uas khaws cov ntaub ntawv, thaum tus neeg siv khoom yog lub khoos phis tawj uas nkag mus rau hauv cov ntawv sib koom los ntawm kev teeb tsa nws ua lub zog tsav. NFS yuav tsum xub teeb tsa ntawm server thiab cov khoos phis tawj uas koj xav siv.
Kauj Ruam 3. Qhib lub davhlau ya nyob twg ntawm lub server server
Nov yog lub khoos phis tawj uas khaws cov ntaub ntawv sib qhia. Koj yuav tsum qhib thiab nkag mus rau lub server server ua ntej tus neeg siv khoom tuaj yeem teeb tsa cov ntawv sib faib ntawm nws lub khoos phis tawj. Siv lub davhlau ya nyob twg los teeb tsa NFS ntawm server thiab cov khoos phis tawj siv khoom.
Kauj Ruam 4. Hom
sudo apt-tau nruab nfs-kernel-server nfs-common portmap thiab nias Nkag mus.
NFS cov ntaub ntawv yuav raug rub tawm thiab teeb tsa hauv computer.
Kauj Ruam 5. Thaum qhov kev teeb tsa tiav, ntaus
dpkg-reconfigure portmap.
Xaiv "Tsis" hauv cov ntawv qhia zaub mov uas tshwm. Tam sim no cov khoos phis tawj uas nyob hauv lub network tuaj yeem txuas rau cov ntawv sib koom.
Kauj Ruam 6. Hom
sudo /etc/init.d/portmap rov pib dua kom rov pib dua qhov kev pabcuam portmap.
Qhov no yog kom ntseeg tau tias kev hloov pauv tuaj yeem siv tau raug.
Kauj Ruam 7. Tsim phau ntawv teev npe dummy uas yuav siv los qhia cov ntaub ntawv
Cov npe no tsis muaj dab tsi yuav hloov tus neeg siv khoom mus rau cov npe sib koom tiag. Qhov no yuav ua rau koj yooj yim dua yog tias koj xav hloov pauv cov npe sib koom ntawm cov neeg rau zaub mov tom qab yam tsis tas yuav hloov pauv ntawm cov neeg siv computer.
-
Hom.mkdir -p /export /dummyname thiab nias Nkag mus.
Cov npe npe dummyname yuav raug tsim thiab cov neeg siv khoom tuaj yeem saib nws.
Kauj Ruam 8. Ntaus pico /etc /fstab thiab nias Enter
Cov ntaub ntawv /etc /fstab yuav qhib thiab tso cai rau koj kom cia li nce qhov sib koom ua ke thaum lub server server pib.
Kauj ruam 9. Ntxiv
sharedpath dummypath tsis khi 0 0 qhov kawg ntawm cov ntaub ntawv.
Hloov pauv txoj kev sib koom mus rau qhov chaw sib koom tsav tsheb thiab hloov qhov dummypath mus rau qhov chaw qhia dummy koj tau tsim ua ntej.
Piv txwv li, yog tias koj xav qhia /dev /sdb tsav nrog cov neeg siv siv cov npe tsim dummy, koj yuav ntaus /dev /sdb /export /Sib koom tsis khi 0 0. Txuag cov ntaub ntawv hloov pauv
Kauj ruam 10. Qhib qhov
/etc/xa tawm.
Koj yuav tsum ntxiv cov npe dummy thiab IP chaw nyob uas tau tso cai nkag mus rau cov ntaub ntawv. Siv hom ntawv hauv qab no los qhia rau txhua tus IP chaw nyob ntawm koj lub network hauv zej zog:/export/dummyname 192.168.1.1/24(rw, no_root_squash, async).
Kauj Ruam 11. Siv qhov hais kom ua
sudo /etc/init.d/nfs-kernel-server rov pib dua kom rov pib dua NFS server.
Ntu 2 ntawm 2: Txuas Cov Neeg Siv Khoom Khoos Phis Tawj
Kauj Ruam 1. Qhib lub davhlau ya nyob twg ntawm lub khoos phis tawj neeg siv khoom
Kauj Ruam 2. Hom
sudo apt-tau nruab portmap nfs-ntau thiab nias Nkag mus txhawm rau txhim kho NFS cov neeg siv khoom cov ntaub ntawv.
Kauj Ruam 3. Tsim cov npe uas cov ntaub ntawv sib koom yuav raug teeb tsa
Koj tuaj yeem sau nws txhua yam. Piv txwv li, koj tuaj yeem ntaus mkdir /sharedFiles los tsim cov npe hu ua "sharedFiles".
Kauj Ruam 4. Hom
pico /etc /fstab qhib cov ntaub ntawv /etc/fstab.
Kauj Ruam 5. Ntxiv
serverIP: qhia tawm nfs rsize = 8192, wsize = 8192, sijhawm = 14, intr qhov kawg ntawm cov ntaub ntawv.
Hloov serverIP rau IP chaw nyob ntawm tus neeg rau zaub mov NFS lub computer. Hloov pauv cov koom nrog cov npe dummy koj tau tsim ntawm NFS server thiab cov npe hauv zos uas koj tau tsim. Txog tam sim no, koj tsis tas yuav hloov lwm qhov hloov pauv.
Siv cov piv txwv saum toj no, kab hais kom ua yuav zoo li: 192.168.1.5:/export/Shared/sharedFiles nfs rsize = 8192, wsize = 8192, timeo = 14, intr
Kauj Ruam 6. Hom
sudo /etc/init.d/portmap rov pib dua kom rov pib dua portmap thiab siv qhov chaw tshiab.
Kev sib koom tsav yuav raug teeb tsa ncaj qha txhua lub sijhawm qhib lub khoos phis tawj.
Kauj Ruam 7. Sim txhim kho tus tsav ua ntej rov pib kho lub computer
Ntaus mount -a ces ls /sharedFiles thiab pom yog tias cov ntaub ntawv sib qhia tshwm ntawm qhov screen.
Kauj Ruam 8. Rov ua cov txheej txheem no txuas txhua lub khoos phis tawj
Siv tib qhov chaw thiab lub khoos phis tawj yuav txuas.