Home > Article > System Tutorial > A preliminary understanding of the NFS service under Linux
1) The service consumer (client) calls the service through local calling;
2) After receiving the call, the client stub is responsible for assembling methods, parameters, etc. into a message body that can be transmitted over the network;
3) The client stub finds the service address and sends the message to the server;
4) The server stub decodes the message after receiving it;
5) The server stub calls local services based on the decoding results;
6) The local service is executed and the results are returned to the server stub;
7) The server stub packages the return result into a message and sends it to the consumer;
8) The client stub receives the message and decodes it;
9) The service consumer gets the final result.
NFS IntroductionNFS (Network File System) is one of the file systems supported by FreeBSD. It allows computers on the network to share resources through the TCP/IP network. In NFS applications, local NFS client applications can transparently read and write files located on the remote NFS server, just like accessing local files.
Currently, NFS mainly has two versions (NFSv2, NFSv3). In addition to version 3 of NFSv2 and NFSv3, which supports more new features, the main difference should be that NFSv2 uses the UDP protocol for transmission, so the connection of NFSv2 It may not be so reliable in complex network environments, and NFSv3 supports both UDP and TCP protocols.
I just took a look and found that Centos7 already supports the NFSv4 protocol. I won’t post NFSv4 here. Let’s take a look at v4 when you have time.
When the client wants to mount an NFS shared volume, it will send an RPC request to the server, and the NFS server will send a random cookie to the client after user authentication so that the client can use this cookie for authentication. Those shared volumes to be accessed.
NFS authentication supports built-in IP/host permission allocation and is also restricted by tcp wrappers.
NFS service on RedhatNFS support is enabled by default in the Redhat kernel, and the startup of the NFS server is controlled through the NFS Daemon, which is responsible for binding network sockets and RPC calls. It also requires an rpcbind service (named in redhat5 portmap), if you cannot find the nfs service in the system, it is because the nfs-utils package is not installed. This package provides some tools and service scripts.
The entire NFS service probably includes the following (copied from Red Hat official documentation, but it seems a bit old):
NFS service provides these RPC calls (functions):
NFS configuration file is in /etc/exports
The default is an empty file. You only need to configure it in the following format, one shared volume per line
host:Limited host (domain name)
1.Single host or IP
2. Wildcard * (matches any character) or ? (matches any single character), used in domain names or host names
3.IP/MASK, for example 192.168.110.0/24
options: Mounting options, used to limit the mounting permissions of the previous host.
Common options:
The above is the detailed content of A preliminary understanding of the NFS service under Linux. For more information, please follow other related articles on the PHP Chinese website!