Upstream -> Implement Load Balancing (upstream) -> Implement High availability (upstream)Copy the code
Install Docker
- Configure domestic mirror speed www.jianshu.com/p/4002f93c8…
Install nginx
-
Refer to www.cnblogs.com/shulipeng/p…
-
Nginx. conf is not available in this document
location / { root /usr/share/nginx/html; index index.html index.htm; } P.S. Since the start command in the reference link does not map the root directory, the root should be changed to the corresponding root directory in the docker container, of course, you can also add this mapping to the start docker command
Three, install Keepalived
-
Refer to www.cnblogs.com/shulipeng/p…
-
Keepalive.conf should be paid attention to
# card name, replace the network card name (IP add or ifconfig can check the card name) interface eno16777736
Iv. VIP(supplement to Keepalived)
- There are two ways to set up a VIP.
- One is to configure the local :vim /etc/sysconfig/network-scripts/
- The other is based on Keepalived, this article is based on keepalived way
Five, the problem of
Question1, SECURITY VIOLATION – scripts are being executed but script_security not enabled
Vrrp_script has no problem being executed. Chmod -r 775 nginx_check.sh script file – another big catch is that if the nginx_check.sh file is created on Windows and uploaded to Linux server, it will never execute. To see if set ff= Unix if not:
P.S. Remember the most direct way to check. /nginx_check.sh to see if there is a problem with the file