NSF共享存储服务的搭建

NSF共享存储服务

一:准备使用环境
○1
Server1:20.0.0.30(需要安装rpcbind和nsf软件包)
Server2:20.0.0.10(安装apache)
Server3:20.0.0.20(安装apache)
○2实验目的
利用nfs存储服务来实现制作两个不同的网页,将这两个网页分别作为两个网站的主页。
○3关闭防火墙
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0

二:安装软件包
Server1:
[[email protected] ~]# yum -y install httpd
Server2:
[[email protected] ~]# yum -y install httpd

Server3:
[[email protected] ~]# yum -y install nfs-utils rpcbind

三:使用chkconfig工具管理nfs、rpcbind服务
[[email protected] ~]# chkconfig --level 35 nfs on
[[email protected] ~]# chkconfig --level 35 rpcbind on
四:创建这俩个网站的的网页目录
NSF共享存储服务的搭建
NSF共享存储服务的搭建
五:设置设置目录为只读
[[email protected] opt]# vi /etc/exports
NSF共享存储服务的搭建
六启动rpcbind、nfs服务
[[email protected] opt]# systemctl start rpcbind
[[email protected] opt]# systemctl start nfs
七:查看共享目录
NSF共享存储服务的搭建
NSF共享存储服务的搭建
NSF共享存储服务的搭建
八:启动httpd服务
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl start httpd
九:将服务上去的目录挂载到本地
[[email protected] ~]# mount 20.0.0.30:/opt/web1 /var/www/html/
NSF共享存储服务的搭建
[[email protected] ~]# mount 20.0.0.30:/opt/web2 /var/www/html/
NSF共享存储服务的搭建
十:测试服务是否成功
NSF共享存储服务的搭建
NSF共享存储服务的搭建
十一:设置永久挂载
[[email protected] ~]# vi /etc/fstab
NSF共享存储服务的搭建
[[email protected] ~]# mount –a

[[email protected]~]# vi /etc/fstab
NSF共享存储服务的搭建
[[email protected] ~]# mount -a