当前位置:网站首页>网络文件系统服务(NFS)
网络文件系统服务(NFS)
2022-07-28 10:25:00 【[email protected]】
一、NFS基本原理
网络文件系统是使不同的计算机之间能通过网络进行文件共享的一种网络协议,多用于UNIX系统的网络中。NFS服务只用于(Linux系统)之间的文件共享。
二、NFS工作原理
NFS服务是基于客户机/服务器模式的。NFS服务器是提供输出文件(共享目录文件)的计算机,而NFS客户端是访问输出文件的计算机,它可以将输出文件挂载到自己的系统中的某个目录文件中。
NFS客户和NFS服务器通过远程过程调用协议实现数据传输。NFS服务器上的目录如果可以被远程用户访问,就称为导出(export);客户主机访问服务器导出目录的过程称为挂载(mount)或导入。
三、NFS组件
NFS服务主要由6个部分组成。前3个必需有,后3个可选。
1、rpc.nfsd :判断、检查客户端是否具备登录主机的权限,负责处理NFS请求
2、rpc.mounted :管理NFS的文件系统
3、rpcbind :进行端口映射工作
4、rpc.locked:处理崩溃系统的锁定恢复
5、rpc.stated:处理客户与服务器之间的文件锁定问题
6、rpc.quotad:提供NFS和配额管理程序之间的接口。
四、安装、启动和停止NFS服务器
1、所需要的套件
至少需要两个套件
(1)rpcbind
(2)nfs-utils
nfs-utils提供rpc.nfsd和rpc.mounted这两个守护进程与其他相关文档、执行文件的套件。
2、安装NFS服务
检测系统是否安装了NFS相关性软件包
rpm -qa|grep nfs-utils
rpm -qa|grep rpcbind
(1)使用yum命令安装NFS服务
yum clean all //安装前先清除缓存
yum install rpcbind -y
yum install nfs-utils -y
(2)使用rpm命令再次查询
rpm -qa|grep nfs
查询结果:
libnfsidmap…
nfs-utils…
rpm -qa|grep rpc
查询结果:
libtirpc…
xmlrpc…
rpcbind…
xmlrpc-c-client…
3、启动NFS服务
查询NFS的程序是否在正常运行
rpcinfo -p
若未看到nfs和mounted选项,则说明NFS未运行,需启动它。使用以下命令启动。
systemctl start rpcbind
systemctl start nfs
systemctl start nfs-server
systemctl enable nfs-server
systemctl enable rpcbind
五、配置NFS服务
主要配置文件:/etc/exports
1、需要的虚拟机情况
一台NFS服务器,主机名为Server1,规划好IP地址如:192.168.10.1
一台NFS客户端,主机名为Client1,规划好IP地址如:192.168.10.20
NFS服务器和客户端的网络连接方式均为VMnet1
2、exports文件格式
如果系统中无/etc/exports,那么手动创建。
mkdir /tmp1
vim /etc/exports
/tmp1 192.168.10.20/24(ro) localhost(rw) *(ro,sync)
#共享目录 第一台主机(权限) 可用主机名 其他主机(可用通配符)
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44250317/article/details/111698707
边栏推荐
- 机器学习--手写英文字母3--工程特点
- 蓝桥杯嵌入式-HAL库-USART_RX
- Read write separation standby backup error
- Test question discovery ring of previous test questions
- 乱打日志的男孩运气怎么样我不知道,加班肯定很多
- Inverse element & combinatorial number & fast power
- PyQt5快速开发与实战 4.12 日历与时间
- RoboCup (2D) experiment 50 questions and the meaning of main functions
- c语言进阶篇:指针(一)
- 产品端数据分析思维
猜你喜欢

SDUT Round #9 2020-新春大作战

QT generation Exe file and run without QT environment (enigma virtual box for green executable software packaging) graphic tutorial

SDUT Round 9 2020 Spring Festival campaign

GKBillowNoiseSource
c语言进阶篇:指针(一)

Pyqt5 rapid development and practice 4.12 calendar and time

非关系型数据库MongoDB的特点及安装

GKSpheresNoiseSource

蓝桥杯电子类嵌入式第十届省赛
Advanced C language: pointer (1)
随机推荐
Semeval 2022 | introducing knowledge into ner system, aridamo academy won the best paper award
GKVoronoiNoiseSource
7. MapReduce custom sorting implementation
GKConstantNoiseSource
11_ UE4 advanced_ Change male characters to female characters and modify the animation
两年CRUD,二本毕业,备战两个月面试阿里,侥幸拿下offer定级P6
Go json. Decoder Considered Harmful
Yarn报错:Exception message: /bin/bash: line 0: fg: no job control
Idea create my first project
GKCoherentNoiseSource
机器学习--手写英文字母3--工程特点
ACM寒假集训#5
Solving the optimal solution of particle swarm optimization
Pyqt5 rapid development and practice 4.13 menu bar, toolbar and status bar and 4.14 qprinter
C语言 输入带空格的字符串
GKObstacle
Add new startup logo and startup / shutdown animation in mt6735
试题 历届试题 发现环
Machine learning -- handwritten English alphabet 3 -- engineering features
逆元&组合数&快速幂