007day -- common linux commands for nginx and nfs services, 007day -- linuxnginx
Job:
Cluster creation
1. Deploy nginx reverse proxy for three web services. The scheduling algorithm uses Weighted Round Robin;
2. All web services use shared storage nfs to ensure that all web services have read and write permissions and ensure data consistency;
I. nginx Service
1. install yum install epel-release-y first
2. If no epel source is found after installation, just reinstall it once.
3. Start nginx Installation
4. view the configuration file
5. Install rpcbind and nfs
Ii. Cluster construction 1. Deployment of nginx reverse proxy three web services, scheduling algorithm using Weighted Round Robin;
Weighted Round Robin of Scheduling Algorithms
Reverse Proxy
2. location file address
3. vim/var/www/html/index.html
Change the write content to web1 web2 web3 in sequence
Web page query 192.168.19.129
Web page query 192.168.19.130
Web page query 192.168.19.131
The first three round robin tasks of the weighted round robin algorithm are web1, followed by web1 web2 web3.
2. All web services use shared storage nfs to ensure that all web services have read and write permissions and ensure data consistency;
1. Install the required nfs service software
Yum install rpcbind nfs-utils-y
Create a share directory
Mkdir/share
Touch/share/cmd.txt
Echo cmd_file>/share/cmd.txt
Vim/etc/exports
2. Configuration File Content
3. Start the service
Systemctl start rpcbind. service
Systemctl start nfs-server.service
4. Set startup
Systemctl enable nfs-server.service
Systemctl enable rpcbind. service
5. View
6. Mount and view content
7. Add write permissions to other users to ensure that all web users have read and write permissions.
8. Create a file under web1
9.in web2, you can see web1.txt. Now, in web2, click Delete. txt, and then click Delete successfully under web3. TXT.
10. Delete the TXT file.
11. Now all web services use shared storage nfs. All web Services have read and write permissions and data consistency.