一. Keepalived配置Nginx自动重启,实现7x24提供服务
nginxkeepalived_2">1.编写不停的检查nginx服务器状态,停止并重启,重启失败后则停止keepalived脚本
cd /etc/keepalived/
vim check_nginx_alive_or_not.sh
#---内容如下:---------------
#!/bin/bash
A=`ps -C nginx --no-header |wc -l
cd /etc/keepalived/
vim check_nginx_alive_or_not.sh
#---内容如下:---------------
#!/bin/bash
A=`ps -C nginx --no-header |wc -l