




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
NFSSambaLinuxNFSNFS(網(wǎng)絡(luò)文件系統(tǒng))服務(wù)可以將Linux系統(tǒng)上的文件共享資源掛載到本機(jī)的上,從而使得本機(jī)(Linux客戶端)基于TCP/IP協(xié)議,像使用本機(jī)上的資源那樣讀寫Linux系統(tǒng)上的共享文件。NFS[root@linuxprobe~]#yuminstallnfs-Loadedplugins:langpacks,product-id,subscription-manager(1/2):rhel7/group_gz|134kB00:00(2/2):rhel7/primary_db|3.4MBPackage1:nfs-utils-1.3.0-0.el7.x86_64alreadyinstalledandlatestNothingto1NFSLinux(一臺NFSNFS),12-6IP表12- 兩LinuxIP主機(jī)名稱IPNFS服務(wù)端RHEL NFS客戶端RHEL 策略正常的NFS共享服務(wù)。[root@linuxprobe~]#iptables-F[root@linuxprobe~]#serviceiptablessaveiptables:Savingfirewallrulesto/etc/sysconfig/iptables:[OK第2步:在NFS服務(wù)器上建立用于NFS文件共享的 [root@linuxprobe~]#mkdir/nfsfile[root@linuxprobe~]#od-Rf777/nfsfile[root@linuxprobe~]#echo e "內(nèi)容。我們可以按照“共享的路徑允許的NFS客戶端(共享權(quán)限參數(shù))”的格式,定義要共享的與相應(yīng)的權(quán)限。例如,如果想要把/nfsfile192.168.10.0/24NFS7NFS參 作 當(dāng)NFS客戶端以root管理員 時,映射為NFS服務(wù)器的匿no_root_squash當(dāng)NFS客戶端以root管理 時,映射為NFS服務(wù)器root 無論NFS客戶端使用什么賬戶 ,均映射為NFS服務(wù)器的 請注意,NFS[root@linuxprobe~]#vim/nfsfilerpcbind[root@linuxprobe~]#systemctlrestartrpcbind[root@linuxprobe~]#systemctlenablerpcbind[root@linuxprobe~]#systemctlstartnfs-server[root@linuxprobe~]#systemctlenablenfs-serverln-s'/usr/lib/systemd/system/nfs-server.service''/etc/systemd/system/nfs.target.wants/nfs-NFSshowmount(以及必要的參數(shù),見表12-8)查詢NFS服務(wù)器的共享信息,其輸出格式為“共享的名稱允許使用客戶端地址”。 howmount- NFS- NFS- [root@linuxprobe~]#showmount-e192.168.10.10Exportlistfor192.168.10.10:/nfsfile然后在NFS客戶端創(chuàng)建一個掛載 。使用mount命令并結(jié)合-t參數(shù),指定要掛載的文件系統(tǒng)的類型,并在命令后面寫上服務(wù)器的IP地址、服務(wù)器上的共以及要掛載到本地系統(tǒng)(即客戶端) [root@linuxprobe~]#mkdir[root@linuxprobe~]#mount-tnfs192.168.10.10:/nfsfileNFSfstab[root@linuxprobe~]#cat/nfsfile/readmeeto[root@linuxprobe~]#vim/etc/fstab##CreatedbyanacondaonWedMay419:26:232017#Accessiblefilesystems,byreference,aremaintainedunder#Seemanpagesfstab(5),findfs(8),mount(8)and/orblkid(8)formoreinfo#/dev/mapper/rhel-root/xfsdefaults1UUID=812b1f7c-8b5b-43da-8c06-b9999e0fe48b/bootxfsdefaults1/dev/mapper/rhel-swapswapswapdefaults0/dev/cdrom/media/cdromiso9660defaults0192.168.10.10:/nfsfile/nfsfilenfsdefaults0AutoFsSambaNFS/etc/fstab載的資源太多,則會給網(wǎng)絡(luò)帶寬和服務(wù)器的硬件資源帶來很大負(fù)載。如果mountautofsmount,autofs務(wù)程序是一種Linux系統(tǒng)守護(hù)進(jìn)程,當(dāng)檢測到用戶試圖一個尚未掛載的文件系統(tǒng)時,將自動掛載該文件系統(tǒng)。換句話說,掛載信息填入[root@linuxprobe~]#yuminstallLoadedplugins:langpacks,product-id,subscription-ThissystemisnotregisteredtoRedHatSubscriptionManagement.Youcanusesubscription-managertoregister.rhel|4.1kB00:00ResolvingDependencies-->Runningtransaction>Packageautofs.x86_641:5.0.7-40.el7willbe-->ProcessingDependency:libhesiod.so.0()(64bit)forpackage:-->Runningtransaction>Packagehesiod.x86_640:3.2.1-3.el7willbe-->FinishedDependencyResolutionDependenciesResolvedPackageArchVersionRepositoryautofsx86_641:5.0.7-40.el7rhel550kInstallingfordependencies:hesiodx86_643.2.1-3.el7rhel30kTransactionSummaryInstall1Package(+1Dependentpackage)Totaldownloadsize:579kInstalledsize:3.6Isthisok[y/d/N]:yDownloadingTotal9.4MB/s|579kB00:00RunningtransactioncheckRunningtransactiontestTransactiontestsucceededRunningtransactionInstalling:hesiod-3.2.1-3.el7.x86_641/2Installing:1:autofs-5.0.7-40.el7.x86_642/2Verifying:hesiod-3.2.1-3.el7.x86_641/2Verifying:1:autofs-5.0.7-40.el7.x86_642/2autofs.x86_641:5.0.7-40.el7DependencyInstalled:hesiod.x86_640:3.2.1-3.el7處于生產(chǎn)環(huán)境中的Linux服務(wù)器,一般會同時管理許多設(shè)備的掛載操作。如果把這些設(shè)備掛載信息都寫入到autofs服務(wù)的主配置文件中,無疑會讓主配置文件臃腫,不利于服務(wù)執(zhí)行效率,也不利于日后修改里面的配置內(nèi)容,因此在autofs服務(wù)程序的主配置文件中需要按照“掛載 寫成/media即可。對應(yīng)的子配置文件則 行定義,文件名字沒有嚴(yán)格要求,但后綴建議以.misc結(jié)束。具體的配置參數(shù)如第7行的加粗字所示。[root@linuxprobe~]#vim/etc/auto.master#Sampleauto.master#Thisisanautomountermapandithasthefollowingformat#key[-mount-option ma]location#Fordetailsoftheformatlookatautofs(5)./media/misc/etc/auto.misc#NOTE:mountsdonefromahostsmapwillbemountedwiththe#"nosuid"and"nodev"optionsunlessthe"suid"and"dev"#optionsareexplicitlygiven./net-##Include/etc/auto.master.d/*.autofs#Includecentralmastermapifitcanbefoundusing#nsswitchsources.##Notethatifthereareentriesfor/netor/misc#above)intheincludedmastermapanykeysthatarethe#samewillnotbeseenasthefirstreadkeyseentakes#precedence.# 掛載文件類型及權(quán)限:設(shè)備名稱”的格式 iso,而-fstype為文件系統(tǒng)格式參數(shù),iso9660為光盤設(shè)備格式,ro、nosuid及nodev為光盤設(shè)備具體的權(quán)限參數(shù),/dev/cdrom則是定義要掛載的設(shè)備名稱。配置完成后再順手將autofs服務(wù)程序啟動并加入到系統(tǒng)啟動項中:[root@linuxprobe~]#vim -fstype=iso9660,ro,nosuid,nodev:/dev/cdrom[root@linuxprobe~]#systemctlstartautofs[root@linuxprobe~]#systemctlenableautofsln-s'/usr/lib/systemd/system/autofs.service'認(rèn)光盤設(shè)備沒有被掛載上,而且/mediaiso。但是,cdiso子中,而且光盤設(shè)備會被立即自動[root@linuxprobe~]#df-FilesystemSizeUsedAvailUse%Mounted/dev/mapper/rhel-root18G3.0G15G17%/devtmpfs905M0905M0%/devtmpfs914M140K914M1%/dev/shmtmpfs914M8.9M905M1%/runtmpfs914M0914M0%/dev/sda1497M119M379M24%/boot[root@linuxprobe~]#cd/media[root@linuxprobemedia]#ls[root@linuxprobemedia]#cdiso[root@linuxprobeiso]#ls-ltotaldr-xr-xr-47dr-xr-xr-37-r--r--r--14-r--r--r--.1rootroot18092Mar62012dr-xr-xr-37dr-xr-xr-27dr-xr-xr-27-r--r--r--.1rootroot108May72017dr-xr-xr-x.2rootroot774144May72017dr-xr-xr-x.24rootroot6144May72017release-dr-xr-xr-27-r--r--r--11RPM-GPG-KEY-redhat--r--r--r--11RPM-GPG-KEY-redhat
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 早餐店品牌授權(quán)與承包合同
- 高端家具定制誠意金支付合同標(biāo)準(zhǔn)范本
- 2025【標(biāo)準(zhǔn)范本】云服務(wù)器租用合同
- 餐飲企業(yè)員工勞動合同范本(含員工培訓(xùn)補(bǔ)貼協(xié)議)
- 美食廣場餐飲經(jīng)營管理權(quán)委托合同
- 2025年的房屋租賃版合同
- 2025企業(yè)標(biāo)識及產(chǎn)品商標(biāo)設(shè)計委托合同
- 2025關(guān)于個人房產(chǎn)抵押貸款合同范本模板
- 2025年最的設(shè)備采購合同趨勢分析
- c語言期末考試題及答案陜師大
- 浦發(fā)銀行個人信用報告異議申請表
- 機(jī)械設(shè)計鏈板式輸送裝置-說明書
- 《工業(yè)生態(tài)學(xué)》課程介紹與教學(xué)大綱
- 朗文定義詞匯表中英對照
- AFC檢測技術(shù)規(guī)程
- 餐飲行業(yè)抖音代運營方案
- 抗震支架設(shè)計流程
- 中國絲綢簡述ppt課件
- 蘇軾《浣溪沙》優(yōu)秀課件
- 塑料包裝袋購銷合同
- 年產(chǎn)40萬噸甲醇合成工藝設(shè)計
評論
0/150
提交評論