NFS的安装配置:
centos 5 :
yum install nfs-utils portmap
centos 6 :
yum install nfs-utils rpcbind
本节是使用centos 6的配置过程:
设备:两台 centos6 OS 安装的时候选择的是"Basic Server"软件配置包。
首先,让两台机器都安装NFS的 软件包,如下显示的是服务器端:
[root@roothomes /home]$ yum install nfs-utils rpcbind
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Setting up Install Process
Package rpcbind-0.2.0-8.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.2.3-15.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
nfs-utils x86_64 1:1.2.3-15.el6 base 308 k
Transaction Summary
================================================================================
Install 0 Package(s)
Upgrade 1 Package(s)
Total download size: 308 k
Is this ok [y/N]: y
Downloading Packages:
nfs-utils-1.2.3-15.el6.x86_64.rpm | 308 kB 00:10
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
base/gpgkey | 3.3 kB 00:00 ...
Importing GPG key 0xC105B9DE "CentOS-6 Key (CentOS 6 Official Signing Key) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
/data 本机mount的目录
1.服务端和客户端都需要开启portmap服务。RCP是nfs mount和umount时通信的方式。
2.假如客户端portmap没有启动,mount时,会非常慢,最终会失败。umount时,即使本地的portmap是关闭的,也能umount成功。
3.挂载完成后,服务端的portmap停止后,nfs仍然工作正常,但是umout财会提示: not found / mounted or server not reachable。重启服务器的portmap也无济于事。
4.假如服务端的portmap重启了,那么nfs也要跟着重启,否则nfs工作仍然是不正常的。
5.假如服务端nfs关闭(IP是通的),这时客户端会无法umount,这时使用umount -f /nfs一般能成功,当服务端死机时,umount -f /nfs 有可能会失败,这时可以使用 umount -l /nfs .
最终建议:
1.使用NFS,就要使用portmap或者rpcbind,NFS严重依赖于portmap或者rpcbind,所以不要试图去停止它(portmap或者rpcbind)。
2.当不能umount /nfs 分区时,试着使用umount -f /nfs,一般都能成功。
3.当umount -f /nfs不能umount时,可以试试umount -l /nfs. umount -l是最终级的umount。