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 Requirement: Query ongoing acti...
By default, PHP on CentOS 7 runs as apache or nob...
Overview The builder pattern is a relatively simp...
1. Installation of the decompressed version (1). ...
The simple installation configuration of mysql5.7...
1. What is HTML HTML (HyperText Markup Language):...
This article shares the specific code for impleme...
1. Problem Description root@mysqldb 22:12: [xucl]...
This article shares the specific code of Vue3 man...
I recently used Docker to upgrade a project. I ha...
The specific code for implementing skinning with ...
Preface Recently, our company has configured mbp,...
summary In some scenarios, there may be such a re...
<br /> CSS syntax for table borders The spec...
System environment: Ubuntu 16.04LTS This article ...