Skip to content
- 简介
- 就是文件共享服务器
- NAS是一种存储模式,NFS是实现NAS的一种方法
- 配置
- 0.server和client进行域名解析;关闭防火墙
- vim /etc/hosts
- 192.168.0.129 client
- 192.168.0.200 server
- 1.server端
- 1.安装NFS服务
- 2.创建存储目录
- 3.配置NFS服务
- vim /etc/exports
- /data 192.168.0.0/24(rw,sync,no_root_squash)
- no_root_squash: 这个选项允许 root 用户访问挂载上来的 NFS 卷。
- rw: 这个选项允许 NFS 客户机进行读/写访问。缺省选项是只读的。
- 4.设置开机启动
- systemctl restart rpcbind
- systemctl enable nfs-server
- 5.检查
- 2.client端
- 1.安装NFS服务
- 2.开机自启
- systemctl enable rpcbind.service
- systemctl start rpcbind.service
- 客户端不需要开启NFS服务
- 3.查看 NFS 服务端共享
- 检查 NFS 服务器端是否有目录共
- showmount -e 192.168.0.200
- 4.手动挂载
- mkdir /data
- mount -t nfs 192.168.0.200:/date /date
- 5.自动挂载
- vim /etc/fstab
- 192.168.0.200:/data /data nfs defaults 0 0