面授rhce nfs如果大家覺得Samba服務程序配置太而且恰巧需要共享文件主機_第1頁
面授rhce nfs如果大家覺得Samba服務程序配置太而且恰巧需要共享文件主機_第2頁
面授rhce nfs如果大家覺得Samba服務程序配置太而且恰巧需要共享文件主機_第3頁
面授rhce nfs如果大家覺得Samba服務程序配置太而且恰巧需要共享文件主機_第4頁
面授rhce nfs如果大家覺得Samba服務程序配置太而且恰巧需要共享文件主機_第5頁
已閱讀5頁,還剩2頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

NFSSambaLinuxNFSNFS(網絡文件系統)服務可以將Linux系統上的文件共享資源掛載到本機的上,從而使得本機(Linux客戶端)基于TCP/IP協議,像使用本機上的資源那樣讀寫Linux系統上的共享文件。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主機名稱IPNFS服務端RHEL NFS客戶端RHEL 策略正常的NFS共享服務。[root@linuxprobe~]#iptables-F[root@linuxprobe~]#serviceiptablessaveiptables:Savingfirewallrulesto/etc/sysconfig/iptables:[OK第2步:在NFS服務器上建立用于NFS文件共享的 [root@linuxprobe~]#mkdir/nfsfile[root@linuxprobe~]#od-Rf777/nfsfile[root@linuxprobe~]#echo e "內容。我們可以按照“共享的路徑允許的NFS客戶端(共享權限參數)”的格式,定義要共享的與相應的權限。例如,如果想要把/nfsfile192.168.10.0/24NFS7NFS參 作 當NFS客戶端以root管理員 時,映射為NFS服務器的匿no_root_squash當NFS客戶端以root管理 時,映射為NFS服務器root 無論NFS客戶端使用什么賬戶 ,均映射為NFS服務器的 請注意,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(以及必要的參數,見表12-8)查詢NFS服務器的共享信息,其輸出格式為“共享的名稱允許使用客戶端地址”。 howmount- NFS- NFS- [root@linuxprobe~]#showmount-e192.168.10.10Exportlistfor192.168.10.10:/nfsfile然后在NFS客戶端創建一個掛載 。使用mount命令并結合-t參數,指定要掛載的文件系統的類型,并在命令后面寫上服務器的IP地址、服務器上的共以及要掛載到本地系統(即客戶端) [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載的資源太多,則會給網絡帶寬和服務器的硬件資源帶來很大負載。如果mountautofsmount,autofs務程序是一種Linux系統守護進程,當檢測到用戶試圖一個尚未掛載的文件系統時,將自動掛載該文件系統。換句話說,掛載信息填入[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處于生產環境中的Linux服務器,一般會同時管理許多設備的掛載操作。如果把這些設備掛載信息都寫入到autofs服務的主配置文件中,無疑會讓主配置文件臃腫,不利于服務執行效率,也不利于日后修改里面的配置內容,因此在autofs服務程序的主配置文件中需要按照“掛載 寫成/media即可。對應的子配置文件則 行定義,文件名字沒有嚴格要求,但后綴建議以.misc結束。具體的配置參數如第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.# 掛載文件類型及權限:設備名稱”的格式 iso,而-fstype為文件系統格式參數,iso9660為光盤設備格式,ro、nosuid及nodev為光盤設備具體的權限參數,/dev/cdrom則是定義要掛載的設備名稱。配置完成后再順手將autofs服務程序啟動并加入到系統啟動項中:[root@linuxprobe~]#vim -fstype=iso9660,ro,nosuid,nodev:/dev/cdrom[root@linuxprobe~]#systemctlstartautofs[root@linuxprobe~]#systemctlenableautofsln-s'/usr/lib/systemd/system/autofs.service'認光盤設備沒有被掛載上,而且/mediaiso。但是,cdiso子中,而且光盤設備會被立即自動[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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論