centos安装部署nfs

服务端安装

sudo yum install -y nfs-utils
sudo systemctl enable rpcbind
sudo systemctl start rpcbind
sudo systemctl enable nfs
sudo systemctl start nfs

配置共享目录

mkdir /data/nfs

配置 /etc/exports,添加如下内容

/data/nfs     *(rw,sync,no_root_squash,no_all_squash)
/data/nfs: 共享目录位置。
*: 客户端 IP(18.8.1.0/30) 范围,* 代表所有,即没有限制。
rw: 权限设置,可读可写。
sync: 同步共享目录。
no_root_squash: 可以使用 root 授权。
no_all_squash: 可以使用普通用户授权。

重启nfs服务。检查本地共享目录

showmount -e localhost

客户端安装

sudo yum install -y nfs-utils
sudo systemctl enable rpcbind
sudo systemctl start rpcbind

创建共享目录

mkdir /data/nfs

挂载目录

sudo mount -t nfs 18.8.1.1:/data/nfs /data/nfs

添加自动挂载

sudo vi /etc/fstab

添加一行

18.8.1.1:/data/nfs /data/nfs nfs defaults 0 0
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值