What are the frequently asked questions about nginx+keepalived
This article will explain in detail what are the common questions about nginx+keepalived, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Log view address: / var/log/messages
1. Log hint: WARNING-script'/ etc/keepalived/check_nginx.sh' is not executable for uid:gid 0:0-disabling.
Reason: keepalived monitoring script does not have execute permission
Solution: chmod + x / etc/keepalived/check_nginx.sh
two。 Log hint: / etc/keepalived/check_nginx.sh exited due to signal 15
Solution: the execution time of interval 5 # monitoring script is longer than that of advert_int (5 seconds if not 3 seconds)
Advert_int 1 # heartbeat check interval
3. Log hint: Error exec-ing command'/ etc/keepalived/nginx_check.sh', error 2: No such file or directory
This problem occurs because there is a problem with the format of the script file.
Note: the script needs to be created with vi: after the vi nginx_check.sh; script is written, use the sh nginx_check.sh command to determine whether the script execution is successful.
If there is a problem resolving the error of the executive footer syntax error: unexpected end of file or syntax error near unexpected token `fi'
We can view the format of the script file by using the command: vim nginx_check.sh to enter the editing file world
Type ":" directly, and then type "set ff" after ":". Enter to see the script format, as shown in the following figure, you can see that the current script format is dos.
We need to change the format to unix by entering ": set ff=unix" or ": set fileformat=unix"
4. If MASTER is turned off but BACKUP does not preempt VIP, the problem may be that the firewall is blocking VRRP broadcasts
Solution: add-An INPUT-p vrrp-j ACCEPT to iptables
What are the common questions about nginx+keepalived to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.