亲测无坑!Centos7安装nfs远程挂载

不说没用的开场白!直接干货,上!

yum install nfs-utils rpcbind -y

#客户端、服务端都安装并添加开机启动

mkdir -p /nfs_test

#创建本地存储目录

vim /etc/exports

#默认为空 *为everyone

/nfs_test 10.0.2.15(rw,no_root_squash,no_all_squash,async)

/nfs_test *(rw,no_root_squash,no_all_squash,async)

no_root_squash

#root用户具有完全的管理权限;

async

#数据先暂时在内存中不直接写入磁盘

sync

#表示数据直接同步到磁盘;

systemctl enable rpcbind

systemctl enable nfs

systemctl start rpcbind systemctl start nfs

systemctl status rpcbind systemctl status nfs

exportfs -a

#刷新配置即可生效,无需重启

mkdir /mnt/test

#客户端创建挂载目录

mount -t nfs 10.0.2.17:/nfs_test /mnt/test

#挂载nfs

umount /mnt/test 

#卸载命令

vim /etc/fstab

10.0.2.17:/nfs_test /mnt/test nfs rw,tcp,intr 0 1  

#添加开机自动挂载

#在客户端创建一个文件测试是否可用、服务端是否同步

服务端

成功!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值