What is NFS? network file system A method or mechanism for storing and organizing files over a network. Why use NFS? All front-end application servers receive pictures, files, and videos uploaded by users and put them into the back-end storage. The advantages of shared storage: convenient data search and retrieval; the disadvantages: high pressure on the storage server, and all data will be lost if it fails. How NFS works NFS functions have many services, each of which has its own port and changes frequently. When the client looks for these ports, it needs an intermediary - the RPC service (default port number 111). Workflow: 1. Start the RPC service 2. Start the NFS service (and register the startup port with the RPC service) 3. The client requests NFS service from RPC 4.RPC return port to the client 5. The client uses the returned port address to request NFS to transfer data. Install NFS Service Installation: yum install nfs-utils rpcbind View: rpm -qa nfs-utils rpcbind Start the service and set it to start automatically at boot: systemctl start rpcbind.service systemctl enable rpcbind.service systemctl start nfs systemctl enable nfs Configuring NFS nfs configuration file /etc/exports Run the command man exports to find: The format of the configuration file is: Hosts (permissions) to access the shared directory ①Directory to be shared: Directory for accessing data ②Host to access: Single host: 172.16.1.7 or host name segment: 172.16.1.0/24 or 172.16.1.* ③Permissions: rw readable ro read-only sync write to remote disk (slow, safe) async asynchronously write to remote buffer (fast, unsafe) root_squash anonuid=anonymous user's UID anongid=anonymous user's GID all_squash No matter what user the client is, it will be treated as nfsnobody on the server [root@nfs01 ~]# vim /etc/exports Note: A directory can be shared with multiple hosts at the same time, as shown in the test figure above. Note that there is no space between the parentheses and the preceding character. Create a directory: [root@nfs01 ~]# mkdir -p /data The default user of nfs is nfsnobody, so you need to authorize the directory: [root@nfs01 ~]# chown -R nfsnobody.nfsnobody /data Restart NFS: [root@nfs01 ~]# systemctl reload nfs or exportfs -r (smooth restart) examine: Open the web01 virtual machine and install the rpc and nfs services (in principle, the client only needs to install rpc, but we are testing the showmount command here) Mount the shared directory and create a file test The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Three ways to copy MySQL tables (summary)
>>: How to configure path alias for react scaffolding
This article example shares the specific code of ...
Well, you may be a design guru, or maybe that'...
As the company's influence grows and its prod...
1. Edit the docker.service file vi /usr/lib/syste...
Are you still using rem flexible layout? Does it ...
mysql correctly cleans up binlog logs Preface: Th...
1. HTML Overview 1.HTML: Hypertext Markup Languag...
1. Overview of modules and instructions used to l...
Achieve results html <h2>CSS3 Timeline</...
So after registering a domain name and purchasing...
The <label> tag defines a label (tag) for an...
This article will explain the composition of the ...
The download address of FlashFXP is: https://www....
This article shares the specific code of Vue to i...
1. Background In the context of rapid updates and...