NFS搭建

启动两台虚拟机分别为LAMP-01(此虚拟机为成功搭建网盘的)和rhel-02,并配好ip与yum源
一、关闭两台防火墙
二、在rhel-02中配置如下
1、列出nfs
[root@rhel-02 ~]# yum list | grep nfs

2、安装nfs所有服务

[root@rhel-02 ~]# yum install nfs*

完成安装如下图:

3、启动nfs服务并查看状态

[root@rhel-02 ~]# systemctl start nfs

[root@rhel-02 ~]# systemctl status nfs

4、查看端口:

[root@rhel-02 ~]# cat /etc/services | grep nfs

5、在mnt下创建share文件夹和修改exports文件内容

[root@rhel-02 ~]# mkdir /mnt/share

 [root@rhel-02 ~]# vi /etc/exports

6、重启nfs服务并查看状态

[root@rhel-02 ~]# systemctl restart nfs

[root@rhel-02 ~]# systemctl status nfs

7、修改share权限

[root@rhel-02 ~]# chmod -R 757 /mnt/share

三、在LAMP-01中配置如下

 1、安装nfs-utils服务

[root@LAMP-01 ~]# yum install nfs-utils

安装完成如下图:

2、显示NFS服务器的输出清单

[root@LAMP-01 ~]# showmount -e  192.168.1.113(rhel-02IP) 

3、挂载

[root@LAMP-01 ~]# mount -t nfs 192.168.1.112:/mnt/share   /mnt/shareing

4、拷贝一个文件到shareing下查看结果

[root@LAMP-01 ~]# cp owncloud-10.0.4.zip   /mnt/shareing

 

posted @ 2018-09-17 16:57  捷浅  阅读(314)  评论(0编辑  收藏  举报