NFS共享

目录

一.NFS简介

1.特点

2.NFS优点

3.原理图

二.NFS服务配置搭建

服务端

客户端  

服务端

客户端


一.NFS简介

NFS(Network File System 网络文件服务)

NFS 是一种基于 TCP/IP 传输的网络文件系统协议

1.特点

  • 采用TCP/IP传输网络文件
  • 安全性低
  • 简单易操作
  • 适合局域网环境

2.NFS优点

节省本地存储空间,将常用的数据如:/home 目录,存放在NFS服务器上且可以通过网络访问,将减少本地磁盘的使用率。

3.原理图

二.NFS服务配置搭建

服务端

[root@localhost ~]# systemctl stop firewalld.service 
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum install -y nfs-utils.x86_64  rpcbind.x86_64 
[root@localhost ~]# mkdir /share
[root@localhost ~]# cd /share/
[root@localhost share]# vim /etc/exports
[root@localhost share]# systemctl start rpcbind
[root@localhost share]# systemctl start nfs
[root@localhost share]# exportfs -r
exportfs: No options for /share *: suggest *(sync) to avoid warning
[root@localhost share]# exportfs -v
/share        	<world>(sync,wdelay,hide,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_squash)


客户端中
[root@localhost ~]# mount 192.168.68.30:/share /data
[root@localhost ~]# df -hT

[root@localhost share]# vim /etc/exports

客户端  

 

此时在客户端上是无法创建文件的,是因为配置文件中默认是只读

若想创建文件则需要修改配置文件的权限

服务端

 [root@localhost share]# vim /etc/exports

 

客户端

猜你喜欢

转载自blog.csdn.net/oyyy3/article/details/120608000