CentOS下配置NAS服务

目的:在172.16.20.19上配置nfs服务,共享/data2目录,将其挂载至172.16.20.11和172.16.20.12的/data2

一、服务端

1.安装nfs-utils、rpcbind
yum install -y nfs-utils rpcbind
systemctl enable nfs-server
systemctl enable rpcbind
systemctl start nfs-server
systemctl start rpcbind
2.配置目录
echo "/data2 172.16.20.*(rw,sync,no_root_squash)" >> /etc/exports
exportfs -r    #重载生效
howmount -e    #查看确认

二、客户端

172.16.20.11和172.16.20.12分别执行以下操作

1.安装nfs-utils
yum install -y nfs-utils
2.挂载
showmount -e 172.16.20.19   #确认通信
mkdir /data2    #创建挂载目录
mount -t nfs 172.16.20.19:/data2 /data2
3. 添加开机挂载
echo "172.16.20.19:/data2 /data2 nfs defaults 0 0" >>/etc/fstab

你可能感兴趣的:(CentOS下配置NAS服务)