NFS服务搭建.
NFS服务搭建图解:
服务端:
一、关闭防火墙
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl disable firewalld.service
[[email protected] ~]# systemctl enable firewalld.service
二、下载nfs-utils软件
[[email protected] ~]# yum install -y nfs-utils
三、设置网页存放目录,并写一个简单的网页
[[email protected] ~]# mkdir /webdate
[[email protected] ~]# echo abc123 > /webdate/index.html
四、设置哪个目录被访问(网页存放目录)?掩码、权限?
五、启动nfs-utils软件
[[email protected] ~]# systemctl start nfs-server.service
附):查看一些本主机提供可以被访问的目录
[[email protected] ~]# exportfs -v
客户端:
一、关闭防火墙
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl disable firewalld.service
[[email protected] ~]# systemctl enable firewalld.service
二、下载nfs-utils和http
[[email protected] ~]# yum install -y nfs-utils httpd
三、启动httpd 和 nfs-utils
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
[[email protected] ~]# systemctl start nfs-utils
[[email protected] ~]# systemctl enable nfs-utils
附):查看一下服务端给客户端提供挂载的资料目录
四、挂载到服务端
[[email protected] ~]# mount -t nfs 192.168.1.182:/webdate /var/www/html
附):访问下客户端挂载成功后的效果
转载于:https://blog.51cto.com/kangxi/2126872