免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2823 | 回复: 1
打印 上一主题 下一主题

keepalived 自己的监控还是不起效 我用的版本是1.1.19 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-02 22:08 |只看该作者 |倒序浏览
那个强人帮忙看下!
KEEPALIVE自己监控的端口和CHK_HAPROXY都不起效!
关闭端口和HAPROXY 日志没有任何反应,感觉不会减权重一样! 那个帅哥做过了!帮忙解决下

配置如下:
! Configuration File for keepalived

global_defs {
   notification_email {
         cnseek@gmail.com
   }
   #notification_email_from sns-lvs@gmail.com
   #smtp_server 127.0.0.1
   #smtp_connect_timeout 30
   router_id Haproxy-haB
}

vrrp_script chk_haproxy {
        script "killall -0 haproxy" # cheaper than pidof
        interval 2  # check every 2 seconds
        weight  -40 # default prio: -2 if connect fails
        fall   3     # require 2 failures for failures
        rise   1     # require 1 sucesses for ok
}

vrrp_script chk_http_port {
        script "/tcp/127.0.0.1/80" # connects and exits
        interval 1 # check every 1 second
        weight -40 # default prio: -2 if connect fails
        fall   3     # require 2 failures for failures
        rise   1     # require 1 sucesses for ok
}

vrrp_script chk_http {
        script "/etc/keepalived/check_http.sh" # connects and exits
        interval 1 # check every 1 second
        weight -40 # default prio: -2 if connect fails
        fall   3     # require 2 failures for failures
        rise   1     # require 1 sucesses for ok
}

vrrp_script chk_schedown {
   script "if [ -f /var/run/down ]; then exit 1; else exit 0; fi"
   interval 1  # check every 10 seconds
   weight -40   # if failed, decrease 40 of the priority
   fall   1     # require 2 failures for failures
   rise   1     # require 1 sucesses for ok
}


vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    garp_master_delay 2
    #preempt_delay 300
    virtual_router_id 51
    priority 99
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }

virtual_ipaddress {
       192.168.0.188
}

track_script{
    chk_haproxy weight -40
    chk_http_port weight -40
    chk_http weight -40
    chk_schedown weight -40
}

track_interface {
      eth0 weight -40
      eth1 weight -40
    }

}
~

论坛徽章:
0
2 [报告]
发表于 2011-08-04 14:18 |只看该作者
这个找到问题了~应该是安装问题! 权重不变的问题!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP