#首先确认系统中是否安装了对于的软件rpm -qa|grep -i nfs
#在有网络的情况下使用YUM安装NFS、rpcbind软件包yum install lrzsz nmap tree dos2unix nc -y
yum install -y nfs-utils rpcbind
#rpcbind 服务对于NFS 是必须的,是NFS的动态端口守护进程#所以不启动rcpbind,NFS不启动/etc/init.d/rpcbind start
#NFS启动/etc/init.d/nfs start
#查看rpcbind 端口netstat -lntup|grep rpc
|
|
1
2
3
4
5
6
7
8
|
#确认NFS是否已经启动rpcinfo –pNFS主端口是2049这是不变的#添加开机自启动chkconfig nfs onchkconfig rpcbind on#查看启动项ls /etc/init.d/
|
|
1
|
ls /etc/rc.d/rc3.d/|grep –E ”nfs|rpc”
|
|
1
|
head /etc/init.d/nfs
|
#NFS相关进程
NFS exports 配置
|
1
2
3
4
5
6
7
8
9
|
vi /etc/ exports
/data 172.16.1.0/24(rw,async)异步写入
/data 172.16.1.0/24(rw,sync)写入磁盘
#平滑重启/etc/init.d/nfs reload
#平滑生效/etc/init.d/nfs reload === exports –rv
#检查是否连接成功showmout –e X.X.X.X |
#客户端的配置
|
1
2
3
4
5
6
7
8
9
|
首先安装yum install lrzsz nmap tree dos2unix nc -y
yum install -y nfs-utils rpcbind
启动rpcbind服务//etc/init.d/rpcbind start
加入自启动服务chkconfig rpcbind on挂载mount –t nfs X.X.X.X:/data /mnt
|
查看是否挂载成功
df -h
检查是否能连通
#常见问题解决方法
客户端挂载遇到的问题