NFS配置管理
From: http://www.goooogle.com.cn/Article/NFS-configuration-and-management.aspx
1. NFS概述
?NFS即網(wǎng)絡(luò)文件系統(tǒng),是主機(jī)間通過(guò)網(wǎng)絡(luò)進(jìn)行文件共享的網(wǎng)絡(luò)協(xié)議,最早由Sun公司提出的,多用于Unix操作系統(tǒng)(Windows中也有相應(yīng)版本的實(shí)現(xiàn)) 。
?NFS通常情況下在局域網(wǎng)中使用,用于多臺(tái)主機(jī)共享同一主機(jī)上的文件將源。由于NFS具有共享文件訪問(wèn)快、穩(wěn)定性高等優(yōu)越性能,在工程系統(tǒng)中得到了廣泛應(yīng)用。
?以下應(yīng)用環(huán)境:
?OS:??LINUX AS4/Cent OS 5.2
?NFS Server:?192.168.146.53 hostname 53
?NFS Client:?192.168.146.51 hostname 51
???192.168.146.52 hostname 52
???192.168.138.250 hostname 250
2. NFS安裝
[root@53 ~]# rpm -q nfs-utils portmap
nfs-utils-1.0.9-33.el5
portmap-4.0-65.2.2.1
//系統(tǒng)中已安裝兩個(gè)軟件包
2.1 NFS的安裝包文件
2.2 portmap軟件包
?protmap軟件包中的portmap服務(wù),為NFS和NIS等提供RPC服務(wù)的支持,因此在安裝時(shí)應(yīng)先安裝portmap軟件包。
[root@53 ~]# rpm -ql portmap
/etc/rc.d/init.d/portmap
/sbin/portmap
/usr/sbin/pmap_dump
/usr/sbin/pmap_set
/usr/share/doc/portmap-4.0
/usr/share/doc/portmap-4.0/BLURB
/usr/share/doc/portmap-4.0/CHANGES
/usr/share/doc/portmap-4.0/README
/usr/share/man/man8/pmap_dump.8.gz
/usr/share/man/man8/pmap_set.8.gz
/usr/share/man/man8/portmap.8.gz
2.3 nfs-utils軟件包
nfs-utils軟件包中提供了NFS服務(wù)器程序和相應(yīng)的維護(hù)工具。
[root@53 ~]# rpm -ql portmap
/etc/rc.d/init.d/portmap
/sbin/portmap
/usr/sbin/pmap_dump
/usr/sbin/pmap_set
/usr/share/doc/portmap-4.0
/usr/share/doc/portmap-4.0/BLURB
/usr/share/doc/portmap-4.0/CHANGES
/usr/share/doc/portmap-4.0/README
/usr/share/man/man8/pmap_dump.8.gz
/usr/share/man/man8/pmap_set.8.gz
/usr/share/man/man8/portmap.8.gz
[root@53 ~]# rpm -ql nfs-utils|head
/etc/idmapd.conf
/etc/rc.d/init.d/nfs
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd
/etc/sysconfig/nfs
/sbin/mount.nfs
/sbin/mount.nfs4
/sbin/rpc.lockd
[root@53 ~]# rpm -ql nfs-utils
/etc/idmapd.conf
/etc/rc.d/init.d/nfs
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd
/etc/sysconfig/nfs
/sbin/mount.nfs
/sbin/mount.nfs4
/sbin/rpc.lockd
/sbin/rpc.statd
/sbin/umount.nfs
/sbin/umount.nfs4
/usr/sbin/exportfs
/usr/sbin/gss_clnt_send_err
/usr/sbin/gss_destroy_creds
/usr/sbin/nfsstat
/usr/sbin/nhfsgraph
/usr/sbin/nhfsnums
/usr/sbin/nhfsrun
/usr/sbin/nhfsstone
/usr/sbin/rpc.gssd
/usr/sbin/rpc.idmapd
/usr/sbin/rpc.mountd
/usr/sbin/rpc.nfsd
/usr/sbin/rpc.svcgssd
/usr/sbin/rpcdebug
/usr/sbin/showmount
/usr/share/doc/nfs-utils-1.0.9
/usr/share/doc/nfs-utils-1.0.9/ChangeLog
/usr/share/doc/nfs-utils-1.0.9/INSTALL
/usr/share/doc/nfs-utils-1.0.9/KNOWNBUGS
/usr/share/doc/nfs-utils-1.0.9/Makefile
/usr/share/doc/nfs-utils-1.0.9/Makefile.am
/usr/share/doc/nfs-utils-1.0.9/Makefile.in
/usr/share/doc/nfs-utils-1.0.9/NEW
/usr/share/doc/nfs-utils-1.0.9/README
/usr/share/doc/nfs-utils-1.0.9/THANKS
/usr/share/doc/nfs-utils-1.0.9/TODO
/usr/share/man/man5/exports.5.gz
/usr/share/man/man5/idmapd.conf.5.gz
/usr/share/man/man5/nfs.5.gz
/usr/share/man/man7/nfsd.7.gz
/usr/share/man/man8/exportfs.8.gz
/usr/share/man/man8/gssd.8.gz
/usr/share/man/man8/idmapd.8.gz
/usr/share/man/man8/lockd.8.gz
/usr/share/man/man8/mount.nfs.8.gz
/usr/share/man/man8/mountd.8.gz
/usr/share/man/man8/nfsd.8.gz
/usr/share/man/man8/nfsstat.8.gz
/usr/share/man/man8/nhfsgraph.8.gz
/usr/share/man/man8/nhfsnums.8.gz
/usr/share/man/man8/nhfsrun.8.gz
/usr/share/man/man8/nhfsstone.8.gz
/usr/share/man/man8/rpc.gssd.8.gz
/usr/share/man/man8/rpc.idmapd.8.gz
/usr/share/man/man8/rpc.lockd.8.gz
/usr/share/man/man8/rpc.mountd.8.gz
/usr/share/man/man8/rpc.nfsd.8.gz
/usr/share/man/man8/rpc.statd.8.gz
/usr/share/man/man8/rpc.svcgssd.8.gz
/usr/share/man/man8/rpcdebug.8.gz
/usr/share/man/man8/showmount.8.gz
/usr/share/man/man8/statd.8.gz
/usr/share/man/man8/svcgssd.8.gz
/usr/share/man/man8/umount.nfs.8.gz
/var/lib/nfs
/var/lib/nfs/etab
/var/lib/nfs/rmtab
/var/lib/nfs/rpc_pipefs
/var/lib/nfs/statd
/var/lib/nfs/state
/var/lib/nfs/v4recovery
/var/lib/nfs/xtab
3. NFS服務(wù)器的配置
3.1 NFS服務(wù)器的配置文件--exports
?exports文件在目錄“/etc”下,用于配置NFS服務(wù)器所提供的目錄共享。此文件默認(rèn)設(shè)置為空,沒(méi)有配置的輸出的任何的目錄共享,這也是出于安全性的考慮,這樣即使系統(tǒng)啟動(dòng)NFS服務(wù)也不會(huì)提供任何的共享。
?如果需要在NFS服務(wù)器中輸出某個(gè)目錄的共享,需要先在exports文件中進(jìn)行相應(yīng)的設(shè)置。
3.2 exports文件的格式
?exports文件中每行提供一個(gè)共享目錄的設(shè)置,設(shè)置行的格式如下所示:
#要輸出的共享目錄名?客戶(hù)端主機(jī)地址(設(shè)置選擇)
/home/share??*(sync,ro)
?在exports文件的設(shè)置行中,共享目錄和主機(jī)地址間用空格分隔,主機(jī)地址之后緊隨設(shè)置選項(xiàng),設(shè)置選項(xiàng)放置在括號(hào)中,多個(gè)設(shè)置選項(xiàng)間用逗號(hào)分隔。
1) 共享目錄
?共享目錄設(shè)置系統(tǒng)中需要輸出作為共享的目錄路徑,該目錄用于存放網(wǎng)絡(luò)中其它主機(jī)共享的文件。
2) 客戶(hù)端主機(jī)地址
?在exports文件中,客戶(hù)端主機(jī)地址的指定非常靈活,可以是單個(gè)主機(jī)的IP地址或域名,也只可以是指定網(wǎng)段中的主機(jī)或指定域中的主機(jī),如下:
主機(jī)地址格式
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
客戶(hù)端主機(jī)地址??說(shuō)明
────────────────────────────
192.168.1.19??指定IP地址的主機(jī)
nfsclient.test.com?指定域名的主機(jī)
192.168.1.0/24??指定網(wǎng)段中的所有主機(jī)
*.test.com??指定域中的所有主機(jī)
*???所有主機(jī)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3) 設(shè)置選項(xiàng)
?exports文件中的設(shè)置選項(xiàng)較多,經(jīng)常使用的不多,如下:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
設(shè)置選項(xiàng)?說(shuō)明
───────────────────────────────────────────
sync??設(shè)置NFS服務(wù)器同步寫(xiě)磁盤(pán),這樣不會(huì)輕易丟失數(shù)據(jù),NFS服務(wù)器建議使用該選項(xiàng)
ro??設(shè)置輸出的共享目錄只讀,與rw不能同時(shí)使用
rw??設(shè)置輸入的共享目錄可讀寫(xiě),與ro不能同時(shí)使用
secure??NFS通過(guò)1024以下的安全TCP/IP端口發(fā)送
insecure?NFS通過(guò)1024以上的端口發(fā)送
wdelay??如果多個(gè)用戶(hù)要寫(xiě)入NFS目錄,則歸組寫(xiě)入(默認(rèn))?
no_wdelay?如果多個(gè)用戶(hù)要寫(xiě)入NFS目錄,則立即寫(xiě)入,當(dāng)使用async時(shí),無(wú)需此設(shè)置。
hide??在NFS共享目錄中不共享其子目錄
no_hide??共享NFS目錄的子目錄
subtree_check?如果共享/usr/bin之類(lèi)的子目錄時(shí),強(qiáng)制NFS檢查父目錄的權(quán)限(默認(rèn))?
no_subtree_check和上面相對(duì),不檢查父目錄權(quán)限
all_squash?共享文件的UID和GID映射匿名用戶(hù)anonymous,適合公用目錄。
no_all_squash?保留共享文件的UID和GID(默認(rèn))?
root_squash?root用戶(hù)的所有請(qǐng)求映射成如anonymous用戶(hù)一樣的權(quán)限(默認(rèn))?
no_root_squash?root用戶(hù)具有根目錄的完全管理訪問(wèn)權(quán)限
anonuid=xxx?指定NFS服務(wù)器/etc/passwd文件中匿名用戶(hù)的UID
anongid=xxx?指定NFS服務(wù)器/etc/passwd文件中匿名用戶(hù)的GID
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4) exports文件配置實(shí)例
?在exports文件中,同一輸出共享目錄對(duì)于不同的主機(jī)可以有不同的設(shè)置選項(xiàng),各主機(jī)間用空格分隔。
# more /etc/exports
/home/share?*(sync,ro) 192.168.1.19(sync,rw)
/home/ftp?192.168.1.0/24(sync,ro)
/home/public?192.168.1.19(sync,rw)
[root@53 ~]# cat /etc/exports
/nfs/mail?????? 192.168.146.51(sync,rw) 192.168.146.52(sync,rw)
/nfs/netdisk??? 192.168.146.51(sync,rw) 192.168.146.52(sync,rw) 192.168.138.250(sync,rw)
3.3 NFS服務(wù)器的啟動(dòng)與停止
1) 啟動(dòng)NFS服務(wù)器
[root@53 ~]# service portmap start
Starting portmap:????????????????????????????????????????? [? OK? ]
[root@53 ~]# service nfs start???
Starting NFS services:???????????????????????????????????? [? OK? ]
Starting NFS quotas:?????????????????????????????????????? [? OK? ]
Starting NFS daemon:?????????????????????????????????????? [? OK? ]
Starting NFS mountd:?????????????????????????????????????? [? OK? ]
2) 查詢(xún)NFS服務(wù)器狀態(tài)
[root@localhost ~]# service portmap status
portmap (pid 2910) is running...
[root@localhost ~]# service nfs status???
rpc.mountd (pid 9740) is running...
nfsd (pid 9737 9736 9735 9734 9733 9732 9731 9730) is running...
3) 停止NFS服務(wù)器
?在需要停止NFS服務(wù)器運(yùn)行時(shí),需要先停止nfs服務(wù)再停止portmap服務(wù),對(duì)于系統(tǒng)中有其他服務(wù)(如NIS服務(wù)) 需要使用portmap服務(wù)時(shí),不需要停止portmap服務(wù)
[root@53 ~]# service nfs stop
關(guān)閉 NFS mountd:????????????????????????????????????????? [? 確定? ]
關(guān)閉 NFS 守護(hù)進(jìn)程:??????????????????????????????????????? [? 確定? ]
關(guān)閉 NFS quotas:????????????????????????????????????????? [? 確定? ]
關(guān)閉 NFS 服務(wù):??????????????????????????????????????????? [? 確定? ]
[root@53 ~]# service portmap stop
停止 portmap:???????????????????????????????????????????? [? 確定? ]
4) 設(shè)置NFS服務(wù)器的自動(dòng)啟動(dòng)狀態(tài)
// 查看
[root@53 ~]# chkconfig --list portmap
portmap???????? 0:off?? 1:off?? 2:off?? 3:on??? 4:on??? 5:on??? 6:off
[root@localhost ~]# chkconfig --list nfs
nfs???????????? 0:off?? 1:off?? 2:off?? 3:off?? 4:off?? 5:off?? 6:off
// 設(shè)置
[root@53 ~]# chkconfig --level 345 portmap on
[root@53 ~]# chkconfig --level 345 nfs on
// 查看設(shè)置結(jié)果
[root@53 ~]# chkconfig --list portmap
portmap???????? 0:off?? 1:off?? 2:off?? 3:on??? 4:on??? 5:on??? 6:off
[root@53 ~]# chkconfig --list nfs
nfs???????????? 0:off?? 1:off?? 2:off?? 3:on??? 4:on??? 5:on??? 6:off
3.4 showmount命令
?在設(shè)置了NFS共享目錄并正確啟動(dòng)了NFS服務(wù)器后,可以使用showmount命令查詢(xún)NFS服務(wù)器的共享目錄狀態(tài)。
1) 顯示showmount命令幫助
[root@datacenter ~]# showmount -h
Usage: showmount [-adehv]
?????? [--all] [--directories] [--exports]
?????? [--no-headers] [--help] [--version] [host]
2) 顯示主機(jī)的NFS服務(wù)器信息
showmount [NFS服務(wù)器主機(jī)地址]
[root@53 ~]# showmount
Hosts on localhost.localdomain:
[root@53 ~]# showmount 192.168.146.53
Hosts on 192.168.146.53:
3) 顯示NFS服務(wù)器的輸出列表
showmount -e [NFS服務(wù)器主機(jī)地址]
[root@53 ~]# showmount -e
Export list for localhost.localdomain:
/nfs/mail??? 192.168.146.52,192.168.146.51
/nfs/netdisk 192.168.146.52,192.168.146.51
4) 顯示NFS服務(wù)器中被掛載的目錄
showmount -d?[NFS服務(wù)器主機(jī)地址]
[root@53 ~]# showmount -d
Directories on localhost.localdomain:
/nfs/netdisk
[root@53 ~]# showmount -d 192.168.146.53
Directories on 192.168.146.53:
/nfs/netdisk
5) 顯示NFS服務(wù)器的客戶(hù)機(jī)與被掛載的目錄
showmount -a [NFS服務(wù)器主機(jī)地址]
[root@53 ~]# showmount -a
All mount points on localhost.localdomain:
192.168.138.250:/nfs/netdisk
3.5 exportfs命令
?usage: exportfs [-aruv] [host:/path]
?exportfs命令用于維護(hù)當(dāng)前主機(jī)中NFS服務(wù)器的輸出目錄列表。
1) 重新輸出共享目錄(exportfs -rv)
?exportfs -rv使用NFS服務(wù)器重新讀取exports文件中的設(shè)置,使用該命令可以在改變exports文件設(shè)置后,使設(shè)置在當(dāng)前NFS服務(wù)器中生效,而不需要重新啟動(dòng)NFS服務(wù)器。
[root@53 ~]# exportfs -rv
exporting 192.168.146.51:/nfs/netdisk
exporting 192.168.146.52:/nfs/netdisk
exporting 192.168.146.51:/nfs/mail
exporting 192.168.146.52:/nfs/mail
2) 停止輸出所有目錄
# exportfs -auv
3) 輸出所有目錄
# exportfs -av
4. NFS客戶(hù)端設(shè)置
?可以便用mount命令把網(wǎng)絡(luò)中NFS服務(wù)器的共享目錄掛載到本機(jī)的文件系統(tǒng)中。
4.1 顯示NFS服務(wù)器的輸出共享目錄
?在便用mount命令掛載NFS服務(wù)器的共享目錄之前,先查詢(xún)NFS服務(wù)器中是否允許本機(jī)連接相應(yīng)的共享目錄。
[root@192.168.146.52 ~]# showmount -e 192.168.146.53
Export list for 192.168.146.53:
/nfs/mail??? 192.168.146.52,192.168.146.51
/nfs/netdisk 192.168.146.52,192.168.146.51
4.2 掛載NFS服務(wù)器中的共享目錄
mount NFS服務(wù)器地址:共享目錄 本地掛載點(diǎn)目錄
[root@51 ~]# mount -h
Usage: mount -V???????????????? : print version
?????? mount -h???????????????? : print this help
?????? mount??????????????????? : list mounted filesystems
?????? mount -l???????????????? : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
?????? mount -a [-t|-O] ...???? : mount all stuff from /etc/fstab
?????? mount device???????????? : mount device at the known place
?????? mount directory????????? : mount known device here
?????? mount -t type dev dir??? : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
?????? mount --bind olddir newdir
or move a subtree:
?????? mount --move olddir newdir
One can change the type of mount containing the directory dir:
?????? mount --make-shared dir
?????? mount --make-slave dir
?????? mount --make-private dir
?????? mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
?????? mount --make-rshared dir
?????? mount --make-rslave dir
?????? mount --make-rprivate dir
?????? mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using? -L label? or by uuid, using? -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say? man 8 mount .
# mount 192.168.146.53:/nfs/netdisk /netdisk/
// 掛載點(diǎn)“/netdisk/”是已經(jīng)建立的空目錄,可以便用其它的空目錄
[root@250 ~]# mount 192.168.146.53:/nfs/netdisk /mnt/
4.3 顯示當(dāng)前主機(jī)掛載的NFS目錄
[root@250 ~]# mount | grep net
4.4 卸載已掛載的NFS共享目錄
[root@250 ~]# umount /mnt/
// 目錄“/mnt/”為NFS共享目錄掛載點(diǎn)
5. NFS服務(wù)器配置程序
1) 安裝NFS工具
// 查詢(xún)有無(wú)安裝相關(guān)軟件包,
# rpm -q redhat-config-nfs
// 如沒(méi)有可以下載安裝或者通過(guò)光盤(pán)安裝
# mount /mnt/cdrom/
# rpm -ivh /mnt/cdrom/RedHat/RPMS/redhat-config-nfs-x.x.x-x.rpm
2)? 啟動(dòng)NFS服務(wù)器配置程序
X-Windows圖形環(huán)境中:
“主菜單”=>“系統(tǒng)設(shè)置”=>“服務(wù)器設(shè)置”=>“NFS服務(wù)器”
命令行:
# redhat-config-nfs
6. NFS安全
NFS的不安全性主要體現(xiàn)于以下4個(gè)方面:
1、新手對(duì)NFS的訪問(wèn)控制機(jī)制難于做到得心應(yīng)手,控制目標(biāo)的精確性難以實(shí)現(xiàn)
2、NFS沒(méi)有真正的用戶(hù)驗(yàn)證機(jī)制,而只有對(duì)RPC/Mount請(qǐng)求的過(guò)程驗(yàn)證機(jī)制
3、較早的NFS可以使未授權(quán)用戶(hù)獲得有效的文件句柄
4、在RPC遠(yuǎn)程調(diào)用中,一個(gè)SUID的程序就具有超級(jí)用戶(hù)權(quán)限.
加強(qiáng)NFS安全的方法:
1、合理的設(shè)定/etc/exports中共享出去的目錄,最好能使用anonuid,anongid以使MOUNT到NFS SERVER的CLIENT僅僅有最小的權(quán)限,最好不要使用root_squash。
2、使用IPTABLE防火墻限制能夠連接到NFS SERVER的機(jī)器范圍
iptables -A INPUT -i eth0 -p TCP -s 192.168.0.0/24 --dport 111 -j ACCEPT
iptables -A INPUT -i eth0 -p UDP -s 192.168.0.0/24 --dport 111 -j ACCEPT
iptables -A INPUT -i eth0 -p TCP -s 140.0.0.0/8 --dport 111 -j ACCEPT
iptables -A INPUT -i eth0 -p UDP -s 140.0.0.0/8 --dport 111 -j ACCEPT
3、為了防止可能的Dos攻擊,需要合理設(shè)定NFSD的COPY數(shù)目。
4、修改/etc/hosts.allow和/etc/hosts.deny達(dá)到限制CLIENT的目的
/etc/hosts.allow
portmap: 192.168.0.0/255.255.255.0 : allow
portmap: 140.116.44.125 : allow
/etc/hosts.deny
portmap: ALL : deny
5、改變默認(rèn)的NFS端口
NFS默認(rèn)使用的是111端口,但同時(shí)你也可以使用port參數(shù)來(lái)改變這個(gè)端口,這樣就可以在一定程度上增強(qiáng)安全性。
6、使用Kerberos V5作為登陸驗(yàn)證系統(tǒng)
7.NFS故障解決
1、NFSD沒(méi)有啟動(dòng)起來(lái)
首先要確認(rèn)NFS輸出列表存在,否則nfsd不會(huì)啟動(dòng)。可用exportfs命令來(lái)檢查,如果exportfs命令沒(méi)有結(jié)果返回或返回不正確,則需要檢查/etc/exports文件。
2、mountd進(jìn)程沒(méi)有啟動(dòng)
mountd進(jìn)程是一個(gè)遠(yuǎn)程過(guò)程調(diào)用(RPC),其作用是對(duì)客戶(hù)端要求安裝(mount) 文件系統(tǒng)的申請(qǐng)作出響應(yīng)。mountd進(jìn)程通過(guò)查找/etc/xtab文件來(lái)獲知哪些文件系統(tǒng)可以被遠(yuǎn)程客戶(hù)端使用。另外,通過(guò)mountd進(jìn)程,用戶(hù)可以知道目前有哪些文件系統(tǒng)已被遠(yuǎn)程文件系統(tǒng)裝配,并得知遠(yuǎn)程客戶(hù)端的列表。查看mountd是否正常啟動(dòng)起來(lái)可以使用命令rpcinfo進(jìn)行查看,在正常情況下在輸出的列表中應(yīng)該象這樣的行:
100005 1 udp 1039 mountd
100005 1 tcp 1113 mountd
100005 2 udp 1039 mountd
100005 2 tcp 1113 mountd
100005 3 udp 1039 mountd
100005 3 tcp 1113 mountd
如果沒(méi)有起來(lái)的話可以檢查是否安裝了PORTMAP組件。
rpm -qa|grep portmap
3、fs type nfs no supported by kernel
kernel不支持nfs文件系統(tǒng),重新編譯一下KERNEL就可以解決。
4、can't contact portmapper: RPC: Remote system error - Connection refused
出現(xiàn)這個(gè)錯(cuò)誤信息是由于SEVER端的PORTMAP沒(méi)有啟動(dòng)。
5、mount clntudp_create: RPC: Program not registered
NFS沒(méi)有啟動(dòng)起來(lái),可以用showmout -e host命令來(lái)檢查NFS SERVER是否正常啟動(dòng)起來(lái)。
6、mount: localhost:/home/test failed, reason given by server: Permission denied
這個(gè)提示是當(dāng)client要mount nfs server時(shí)可能出現(xiàn)的提示,意思是說(shuō)本機(jī)沒(méi)有權(quán)限去mount nfs server上的目錄。解決方法當(dāng)然是去修改NFS SERVER咯。
7、被防火墻阻擋
這個(gè)原因很多人都忽視了,在有嚴(yán)格要求的網(wǎng)絡(luò)環(huán)境中,我們一般會(huì)關(guān)閉linux上的所有端口,當(dāng)需要使用哪個(gè)端口的時(shí)候才會(huì)去打開(kāi)。而NFS默認(rèn)是使用111端口,所以我們先要檢測(cè)是否打開(kāi)了這個(gè)端口,另外也要檢查T(mén)CP_Wrappers的設(shè)定。
總結(jié)
- 上一篇: C++ 反射机制的简单实现
- 下一篇: masm和dos