這篇文章給大家分享的是有關nfs網絡文件系統如何安裝的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
創新互聯公司堅持“要么做到,要么別承諾”的工作理念,服務領域包括:成都網站制作、做網站、企業官網、英文網站、手機端網站、網站推廣等服務,滿足客戶于互聯網時代的硯山網站設計、移動媒體設計的需求,幫助企業找到有效的互聯網解決方案。努力成為您成熟可靠的網絡建設合作伙伴!
1、安裝nfs服務
yum -y install nfs-utils
2、配置發布的路徑及訪問權限
vim /etc/exports 增加 /nfsPrimary *(rw,async,no_root_squash,no_subtree_check) /nfsSecondary *(rw,async,no_root_squash,no_subtree_check)
同時可以指定誰能夠掛在這個共享出去的文件夾
/nfsPrimary liufukinKVM(rw,async,no_root_squash,no_subtree_check) /nfsSecondary 192.168.10.*(rw,async,no_root_squash,no_subtree_check)
3、配置nfs需要綁定的端口
vim /etc/sysconfig/nfs
找到下面的配置項,并且開啟
LOCKD_TCPPORT=32803 LOCKD_UDPPORT=32769 MOUNTD_PORT=892 RQUOTAD_PORT=875 STATD_PORT=662 STATD_OUTGOING_PORT=2020
4、iptables防洪墻開放端口(要在reject之前增加,否則無效)
vi /etc/sysconfig/iptables
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 111 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 111 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 32803 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 32769 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 892 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 892 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 875 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 875 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 662 -j ACCEPT -A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 662 -j ACCEPT
防火墻重啟
service iptables restart
5、關閉selinux或者開啟允許模式
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config setenforce 0
6、啟動nfs服務器
service rpcbind start service nfs start chkconfig rpcbind on chkconfig nfs on
1、showmout命令對于NFS的操作和查錯有很大的幫助,所以我們先來看一下showmount的用法
showmout -a :這個參數是一般在NFS SERVER上使用,是用來顯示已經mount上本機nfs目錄的cline機器。 -e :顯示指定的NFS SERVER上export出來的目錄。
例如:
showmount -e 192.168.0.30 Export list for localhost: /tmp * /home/linux *.linux.org /home/public (everyone) /home/test 192.168.0.100
2、mount nfs目錄的方法:
mount -t nfs hostname(orIP):/directory /mount/point
具體例子:
Linux: mount -t nfs 192.168.0.1:/tmp /mnt/nfs [root[@localhost](https://my.oschina.net/u/570656) /]# showmount -e 192.168.0.169 Export list for 192.168.0.169: /home/opt/RHEL4U5 192.168.0.0/255.255.252.0 You have new mail in /var/spool/mail/root mount -t nfs 192.168.0.169:/home/opt/RHEL4U5 /mnt/soft
注意:需要安裝nfs,否則會報
mount: wrong fs type, bad option, bad superblock on 125.64.41.244:/data/img, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so
感謝各位的閱讀!關于“nfs網絡文件系統如何安裝”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
新聞標題:nfs網絡文件系統如何安裝
標題網址:http://vcdvsql.cn/article32/jhijsc.html
成都網站建設公司_創新互聯,為您提供網頁設計公司、網站建設、手機網站建設、App設計、網站改版、品牌網站制作
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯