Nginx(三)——高可用

xiaoxiao2025-11-01  66

 

在两台机器上都要安装Nginx。

两台机器上都安装keepalived

service keepalived start

service keepalived stop

service keepalived restart

 

第三步:

查看当前机器的网卡

最后,master上的配置

备份机器上的配置

创建nginx_check.sh

A='ps -C nginx --no-header | wc -l' if [ $A -eq 0 ];then /opt/nginx/sbin/nginx sleep 2 if [ 'ps -C nginx --no-header | wc -l' -eq 0 ];then killall keepalived fi fi

修改权限

 

 

 

 

 

 

 

 

 

 

 

转载请注明原文地址: https://www.6miu.com/read-5038876.html

最新回复(0)