day3-Nfs

文件系统类型

本地文件系统

EXT3/4 SWAP NTFS ...

伪文件系统

/proc /sys .. 内存空间

网络文件系统

NFS (Network File System) 网络存储

NFS共享协议

Unix/Linux最好基本的文件共享机制

1980年由SUN公司开发

信赖于RPC(远程过程调用)映射机制

存取们于远程磁盘中的文档数据,对应用程序是透明的,就好像访问本地的文件一样

NFS依赖于RPC

为一些不固定端口有服务,提供端口注册服务

主要软件包

yum install nfs-utils -y

yum install rpcbind -y

系统服务

/etc/init.d/rpcbind    

/etc/init.d/nfs

主配置文件/etc/exports

主配置文件格式

共享目录 客户机地址(参数,参数...)

参数

可以man exportfsc

这是默认的 sync,ro,root_squash,wdelay

wKiom1exzTiy5aItAABOiJJeAus721.png

wKioL1exzkPBhzsFAABExEMmVpA166.png

[root@localhost ~]# cat /etc/exports 

/file 192.168.100.100(rw,no_root_squash)

/file 192.168.100.0/24(ro)

查看NFS共享列表

showmount -e 服务器地址

[root@localhost ~]# showmount -e 192.168.100.100

Export list for 192.168.100.100:

/file 192.168.100.0/24,192.168.100.100

挂载nfs共享目录

mount -t nfs 服务器地址:共享目录 挂载点

mount 192.168.100.100:/file /test

[root@localhost test]#  mount |tail -1

192.168.100.100:/file on /test type nfs (rw,vers=4,addr=192.168.100.100,clientaddr=192.168.100.100)

原文地址:https://www.cnblogs.com/fina/p/5781860.html