In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the nginx load function + nfs server function example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Use the nfs server to make the web pages of the three server servers consistent
# the contos system used in this article
1. Install nfs-utils [root@nfs-server ~] # yum install nfs-utils-y2 on both nfs servers and 3 server servers. Start the nfs function on the nfs server
The nfs process did not respond because nfs did not listen to the port number, but outsourced it to rpc,rpc to help nfs listen on the port and tell the client to contact the local port.
3. Share the file ①. A shared file web is created under the root, with a web page and two downloadable files
# download function needs to be configured in 3 server, otherwise it cannot be downloaded
two。 Add a line of configuration to the file / etc/exports
/ web the folder to be shared, that is, the web folder I just created under the root
192.168.83.0Universe 24 shared network segment
Rw is readable and writable
All users used by all_squash to represent access are restricted to anonymous users.
Sync writes data to both memory and disk to ensure that data is not lost.
The parameters in # () can be modified, so this article will not explain them in more detail. You can check the details on the official website or other blogs.
4. Refresh the output list
Output the content just written to the configuration file / etc/exports to the specified network segment
5. It is recommended that you turn off the firewall and selinux
Selinux is a mechanism to protect the security of linux system, which is not applicable for the time being. It is recommended to close it.
Setenforece 0 temporarily shuts down selinux
Vim / etc/sysconfig/selinux SELINUX=disabled permanently shuts down selinux
Turn off the firewall
Service firewalld stop-- "shut down the firewalld service now--" temporarily shut down
Systemctl disable firewalld-- "set firewalld service boot not to start--" permanently shut down
6. Mount on the server server
The server side also needs to install the nfs-utils package
Use the showmount-e directive on server to see which folders are shared output on the nfs server
# if the path is unreachable, consider whether the firewall is not turned off
Use the instruction to mount to the specified folder
# Syntax: directory of the mount nfs server, local directory
If you want to unmount, use the directory where umout is mounted, in this case umount / usr/local/nginx1/html/
If you don't remember to mount the directory, you can use the df instruction to view it.
7. Verification effect
The client accesses the load balancer 192.168.83.160, and the data is the same every time. If a server modifies the data, then all server server data will be modified. This is what we call data consistency.
8. How to implement server server to modify data
Although the data from the nfs server is mounted on three server, server cannot manipulate the data, including creating files, and so on.
# whether the server server has write permission depends on two permissions
1. Share permissions-"permissions in the / etc/exports file, such as ro,rw
two。 Permissions in the file system-- "/ web permissions in linux--" authorization in the nfs server
We have already given sharing permissions, so we only need to authorize the shared files in the file system of the nfs server.
We have write permission on the server.
9. Power on and mount automatically
Since each shutdown mount will fail, we need to enable server to boot and mount automatically.
1./etc/rc.localvim / etc/rc.localmount 192.168.83.100:/web / usr/local/nginx1/html-- "add a line chmod + x / etc/rc.d/rc.local--" license file
2/etc/fstabvim / etc/fstab-"add this line
192.168.83.22:/web / usr/local/nginx1/html nfs defaults 0 0
192.168.83.22:/web mounted partition-"nfs's file system"
/ usr/local/nginx1/html local mount point
Nfs file system type
0 whether the demp command is supported for backup
0 whether to check the file of the partition when you turn it on.
Thank you for reading this article carefully. I hope the article "nginx load function + sample Analysis of nfs Server function" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.