1. Introduction to NFSIn the previous article, we explained that K8s mentioned NFS to uniformly store files generated by different Pods. The data volume in K8s directly supports NFS. You can directly specify the IP and directory of the NFS server. In this article, we will learn how to mount the NFS remote directory and mount the specified directories on different servers to the NFS server, which is similar to the shared folder in Windows, so that data can be shared between different servers. Let's experience NFS together. NFS is the abbreviation of Network File System, which means network file system in Chinese. Its main function is to allow different host systems to share files or directories through a network (usually a local area network). The NFS client (usually an application server, such as a web server) can mount the data directory shared by the NFS server to the local system of the NFS client (that is, under a certain mount point) by mounting. From the client's local perspective, the directory shared by the NFS server looks like the client's own disk partition or directory, but in fact it is a directory on the remote NFS server. 2. NFS ConstructionOverall architecture:
The purpose of this article is to ensure that files modified in 161 can be viewed or modified in 162 in a timely manner. 1. NFS server constructionInstall nfs and rpcbind yum -y install nfs-utils rpcbind Set up automatic startup chkconfig nfs on Or systemctl enable nfs.service chkconfig rpcbind on Or systemctl enable rpcbind.service Start the service service rpcbind start service nfs start Create a server-side shared directory and grant permissions mkdir -p /nfs/data && chmod -R 777 /nfs/data Configure exports file vi /etc/exports Add the following content, and pay attention to fill in the server's IP. /nfs/data 192.168.40.160(rw) /nfs/data/ *(insecure,rw,async,no_root_squash) Refresh configuration takes effect immediately exportfs -a View the mount directory showmount -e 192.168.40.160 At this point the server has been built. 2. NFS client constructionInstall nfs-utils yum install nfs-utils Create a directory and grant permissions mkdir -p /nfs/data && chmod -R 777 /nfs/data Hang in directory mount 192.168.40.160:/nfs/data /nfs/data If no error is reported at this point, it will hang on success. 3. TestingCreate the test.txt file on 161 and write some random content: Let's look at the data in 160 or 162: At this point, the NFS remote directory mount is successfully set up! This is the end of this article about the process of using NFS remote directory mounting in CentOS environment. For more relevant content about using NFS directory mounting in CentOS, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: PHP-HTMLhtml important knowledge points notes (must read)
The large-screen digital scrolling effect comes f...
Because the distribution package of MySQL Communi...
Table of contents First, let's talk about the...
(I) Basic concepts of web page color matching (1) ...
1. Use basic text elements to mark up content Fir...
Let's take a look at the command to restart t...
Table of contents 1. Quick understanding of conce...
Table of contents Preface System environment Curr...
XHTML defines three document type declarations. T...
<br />Web Design and Production Test Part I ...
@vue+echarts realizes the flow effect of China ma...
Serve: # chkconfig --list List all system service...
Perfect solution to the scalable column problem o...
1. Download the installation package from the off...
This article example shares the specific code of ...