Centos安装nfs服务

mtain 2022年06月13日 559次浏览

一、服务端安装配置

1.安装并启动服务

yum install -y nfs-utils rpcbind

systemctl start nfs-server
systemctl enable nfs-server
systemctl start rpcbind
systemctl enable rpcbind

2. 配置访问权限

vim  /etc/exports


/data/work 192.168.1.* (rw,sync,root_squash)
/data  192.168.1.105 (rw,sync)  
/public  * (rw,sync)

然后重启

systemctl restart rpcbind
systemctl restart nfs-server

3. 验证nfs服务

# 查看共享目录
exportfs

# 查看服务状态
rpcinfo -p

# 客户端检查是否存在nfs服务
showmount -e nfs服务器的IP

二、客户端挂载

mount -t nfs nfs_server:/data  /nfs
或者
mount -t nfs nfs_server:/data  /nfs -o proto=tcp

windows开启nfs客户端
image.png

mount 192.168.1.101:/data F: