NFS服务端与客户端配置

时间:2023-03-10 00:08:55
NFS服务端与客户端配置
#首先确认系统中是否安装了对于的软件
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

  NFS服务端与客户端配置

1
2
3
4
5
6
7
8
#确认NFS是否已经启动
rpcinfo –p
NFS主端口是2049这是不变的
#添加开机自启动
chkconfig nfs on
chkconfig rpcbind on
#查看启动项
ls /etc/init.d/

  NFS服务端与客户端配置

1
ls /etc/rc.d/rc3.d/|grep –E ”nfs|rpc”

  NFS服务端与客户端配置

1
head /etc/init.d/nfs

  

NFS服务端与客户端配置

#NFS相关进程

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

NFS服务端与客户端配置

NFS服务端与客户端配置

#客户端的配置

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

  NFS服务端与客户端配置

查看是否挂载成功

df -h

检查是否能连通

NFS服务端与客户端配置

#常见问题解决方法

客户端挂载遇到的问题

NFS服务端与客户端配置