nfs(linux+linux)

服务端 192.168.1.15
客户端 192.168.1.157

1服务端安装过程

1.下载 nfs-utils和 rpcbind
yum install -y nfs-utils rpcbind
2.启动rpcbind(必须先启动)
systemctl start rpcbind
3.启动nfs-utils
systemctl start nfs
4.查看进程

ps aux | grep nfs
ps aux | grep rpcbind

5.设置开机自启动

systemctl enable rpcbind
systemctl enable nfs

6.查看自启情况
systemctl list-unit-files --type=service|grep "enabled"|egrep "rpcbind|nfs"
7.创建目录
mkdir /data
8.给权限
chown -R nfsnobody.nfsnobody /data
9.配置共享目录

cat>>/etc/exports<<EOF
> #NFS server share directories
> /data 192.168.1.0/24(rw,sync)
> EOF

10.平滑重启nfs
systemctl reload nfs
11.查看挂载目录
showmount -e 192.168.1.158(服务端Ip)
12.关闭防火墙

systemctl stop firewalld
setenforce 0

13.给/data目录加权限
chmod 777 /data

2 客户端安装

1.下载
yum install nfs-utils rpcbind -y
2.启动rcpbind(不用启nfs)
systemctl start rpcbind
3.设置开机自启动
systemctl enable rpcbind
4.本地查看挂载目录
showmount -e 192.168.1.158
5.设置开机自动挂载

mount -t nfs 192.168.1.158:/data /mnt
echo "mount -t nfs 192.168.1.158:/data /mnt">>/etc/rc.local

6.查看
df -h
7.关闭防火墙

systemctl stop firewalld
setenforce 0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值