Keepalived+nginx 一直报错

Galy_绿 发布于 2017/03/20 21:16
阅读 842
收藏 0

keepalived 的配置

 

! Configuration File for keepalived

global_defs {

    router_id 118.244.212.178

}

vrrp_script chk_nginx {

    script "/etc/keepalived/nginx_check.sh"

    interval 2

    weight -20 

}

vrrp_instance VI_1 {

    state BACKUP

    interface virbr0

    virtual_router_id 51

    mcast_src_ip 192.168.1.125

    priority 90

    nopreempt

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }   

    track_script {

        chk_nginx

    }   

 

    virtual_ipaddress {

        192.168.1.50

    }   

}

 

nginx监测的配置

#!/bin/bash

A=`ps -C nginx –no-header |wc -l`

if [ $A -eq 0 ];then

    /usr/local/nginx/sbin/nginx

    echo "ttttt"

    sleep 2

    if [ `ps -C nginx --no-header |wc -l` -eq 0 ];then

        killall keepalived

    fi  

fi

 

Keepalived_vrrp[29368]: /etc/keepalived/nginx_check.sh exited due to signal 15 一直报这个错误,哪位能给我说说下,这个到底是什么问题

加载中
0
放风喽
放风喽

是vrrp_script{}中interval的间隔时间要大于脚本中的sleep时间

改过后我的可以正常检测了

返回顶部
顶部