Continuing from the previous article, we will create a web02 server, mount the /data directory of the web01 and web02 servers to the shared directory /data of the nfs01 server, and enable automatic startup in different ways. web01: Add the following line to /etc/rc.local: Reboot and check: web02: Clone the template machine, create the web02 virtual machine, change the host name and IP address Install the rpc service: yum install rpcbind Enable and set it to start at boot Add a line at the end: Because disk mounting is faster than network card loading in the system startup sequence, and RPC requires networking, we need to enable delayed mounting: Reboot and check: Note: When mounting at startup, make sure that the nfs01 server and its nfs service are both enabled. View shared directory information on the nfs01 server You can specify user access by setting uid and gid (add the same user on the server and client --- the uid and gid are the same): useradd -u 1111 test Test on web01 server: Summarize: ① The shared directory in the nfs configuration file of the nfs server needs to have write permissions ②The local permissions of the nfs server shared directory should be set to w permissions ③When specifying a user, ensure that the uid and gid of the user on the server and client are the same (the user name can be different) Client Mount In-depth View the client mount information: Two mounting modes: hard and soft If the mount is in soft mode, when a network or service problem occurs, the client will consistently try to mount until the timeout (timeo) stops. If the hard mount is used, the system will keep trying until the mount succeeds. You cannot umount or kill the mount at this time. It is often used with intr. Note: soft may cause data loss after timeout, so it is not recommended. rsize/wsize is the block size for writing/reading, which affects the buffer storage capacity for data transmission between the client and the server. If you are in a local area network and the memory on both sides is relatively large, this value can be set larger to increase the transmission speed. Detailed explanation of the mount command: https://www.runoob.com/linux/linux-comm-mount.html CentOS7.6 optimization recommends using the following mount command: mount -t nfs -o noatime,nodiratime,nosuid,noexec,nodev,rsize=131072,wsize=131072 172.16.1.31:/data /mnt NFS Kernel Optimization Suggestions
The specific commands corresponding to the above files are as follows: 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:
|
<<: How to configure path alias for react scaffolding
>>: Detailed explanation of pure SQL statement method based on JPQL
Table of contents 1. Overview 2. Define a simple ...
1. Introduction to Data Integrity 1. Introduction...
Two examples of the use of the a tag in HTML post...
Table of contents cause reason Introduction to NP...
Preface Many friends who have just come into cont...
Today I used a virtual machine to do an experimen...
1. Introduction to Navicat 1. What is Navicat? Na...
Table of contents Preface Prepare Summarize n way...
After the official release of Activiti7, it has f...
I downloaded and installed the latest version of ...
MySQL advantage: Small size, fast speed, low tota...
When we add an svg image to display, react prompt...
The preparation for the final exams in the past h...
Detailed explanation of the implementation method...
I have always wondered why the MySQL database tim...