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
Table of contents 1. Use the warehouse to create ...
Table of contents Preface start step Troubleshoot...
There are three ways to represent colors in HTML, ...
This article shares the specific code for JavaScr...
When I was asked this question, I was ignorant an...
<body> <div id="root"> <...
In the past, float was often used for layout, but...
Table of contents 1. WordPress deployment 1. Prep...
Whether it is a corporate website, a personal blo...
Preface When operating and managing Linux servers...
Union is a union operation on the data, excluding...
DIV background is semi-transparent, but the words ...
Placing a search box in the top menu bar is a com...
To achieve CSS screen size adaptation, we must fi...