当前位置:网站首页>Network file system service (NFS)

Network file system service (NFS)

2022-07-28 10:49:00 [email protected]

One 、NFS The basic principle

Network file system is to make Different computers Can pass between The Internet Conduct File sharing A network protocol , be chiefly used in UNIX In the network of the system .NFS The service is only used for (Linux System ) Between File sharing .

Two 、NFS working principle

NFS Service is based on The client / The server Mode .NFS Server is Provide output file ( Shared directory file ) The computer , and NFS The client is Access the output file The computer , It can mount the output file to a directory file in its own system .

NFS The customer and NFS Server pass Remote procedure call protocol Realization The data transfer .NFS If the directory on the server can be accessed by remote users , It's called export (export); The process of the client host accessing the server export directory is called mount (mount) Or import .

3、 ... and 、NFS Components

NFS Services are mainly provided by 6 Component composition . front 3 Required , after 3 Options .
1、rpc.nfsd : Judge 、 Check whether the client has the permission to log in to the host , Responsible for handling NFS request
2、rpc.mounted : management NFS File system
3、rpcbind : Conduct Port mapping Work
4、rpc.locked: Handle lock recovery of crashed systems
5、rpc.stated: Handle the file locking problem between the client and the server
6、rpc.quotad: Provide NFS Interface with quota management program .

Four 、 install 、 Start and stop NFS The server

1、 The kit you need

At least two kits are required
(1)rpcbind
(2)nfs-utils
nfs-utils Provide rpc.nfsd and rpc.mounted These two daemons and other related documents 、 Suite of execution files .

2、 install NFS service

Check whether the system is installed NFS Dependency packages
rpm -qa|grep nfs-utils
rpm -qa|grep rpcbind
(1) Use yum Command to install NFS service
yum clean all // Clear the cache before installing
yum install rpcbind -y
yum install nfs-utils -y
(2) Use rpm Command to query again
rpm -qa|grep nfs
Query results :
libnfsidmap…
nfs-utils…
rpm -qa|grep rpc
Query results :
libtirpc…
xmlrpc…
rpcbind…
xmlrpc-c-client…

3、 start-up NFS service

Inquire about NFS Whether the program of is running normally
rpcinfo -p
If you don't see nfs and mounted Options , shows NFS Not running , Need to start it . Start with the following command .
systemctl start rpcbind
systemctl start nfs
systemctl start nfs-server
systemctl enable nfs-server
systemctl enable rpcbind

5、 ... and 、 To configure NFS service

Primary profile :/etc/exports

1、 Virtual machine required

a NFS The server , The host name is Server1, Plan well IP Address: e.g :192.168.10.1
a NFS client , The host name is Client1, Plan well IP Address: e.g :192.168.10.20
NFS The network connection mode of server and client is VMnet1

2、exports File format

If there is no /etc/exports, Then create it manually .
mkdir /tmp1
vim /etc/exports
/tmp1 192.168.10.20/24(ro) localhost(rw) *(ro,sync)
# share directory The first mainframe ( jurisdiction ) Available host names Other hosts ( Wildcards available )

原网站

版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281025239318.html