NFS网络文件系统

1.安装NFS服务器
[root@nas ~]# yum -y install nfs-utils 安装服务端软件
[root@nas ~]# mkdir /webdata 存储网站代码
[root@nas ~]# echo "nfs test..." > /webdata/index.html 放置测试页面
[root@nas ~]# vim /etc/exports 编辑nfs配置文件
2.配置NFS服务器
/webdata 192.168.142.0/24(rw)

3.启动nfs服务器
[root@nas ~]# systemctl start nfs-server
[root@nas ~]# systemctl enable nfs-server
4.检查NFS输出是否正常
[root@nas ~]# exportfs -v -v 检查输出的目录

二、 客户端配置
1.安装NFS客户端
[root@web1 ~]# yum -y install nfs-utils httpd
[root@web1 ~]# systemctl start httpd
[root@web1 ~]# systemctl enable httpd
2.查看存储端共享
[root@web1 ~]# showmount -e 192.168.142.133 // 查询NFS服务器可用目录

3. 手动挂载
[root@web1 ~]# mount -t nfs 192.168.142.133:/webdata /var/www/html/


4.查看挂载
[root@web1 ~]# df

[root@web1 ~]# ls /var/www/html/


浙公网安备 33010602011771号