电信运营商主备状态切换

lvs+keepalive主备状态切换有问题?

现在碰到一个问题。我的环境是2台keealived服务器,2台web服务器。现在我在主lvs服务器中停止keepalived服务后,在备机中能通过ip a看到vip 已经切换至备机,主服务器启动服务后也能夺回vip.但是我通过ifdown eth0中禁用主服务器的网卡后,备机一直不能抢得vip,请问一下大家这个是什么原因造成的呢?
参与2

1同行回答

c6523004c6523004系统工程师电信
这个是我的keepalived的配置,2边配置都一样,除了优先级和stateglobal_defs {notification_email {              [email]123@abc.com[/email]        }       ...显示全部
这个是我的keepalived的配置,2边配置都一样,除了优先级和state
global_defs {
notification_email {
              [email]123@abc.com[/email]
        }
        notification_email_from [email]1234@abc.com[/email]
        smtp_server 192.168.60.30
        smtp_connect_timeout 30
        router_id LVS2
}
vrrp_sync_group test {
group {
        loadbalance
}
}

vrrp_instance loadbalance {
        state BACKUP
        interface eth0
        lvs_sync_daemon_inteface eth0
        virtual_router_id 51
        priority 90
        advert_int 5
        preempt_delay 5
authentication {
        auth_type PASS
        auth_pass 1111
}
virtual_ipaddress {
        192.168.238.240
}
}

virtual_server 192.168.238.240 80 {
        delay_loop 6
        lb_algo rr
        lb_kind DR
        #persistence_timeout 20
        protocol TCP
        real_server 192.168.238.95 80 {
        weight 3
        TCP_CHECK {
        connect_timeout 3
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
}
}
        real_server 192.168.238.94 80 {
        weight 3
        TCP_CHECK {
        connect_timeout 3
        nb_get_retry 3
        delay_before_retry 3
        connect_port 80
}
}
}收起
电信运营商 · 2015-07-20
浏览2203

提问者

c6523004
系统工程师电信
擅长领域: AIX服务器Unix

问题状态

  • 发布时间:2015-07-20
  • 关注会员:1 人
  • 问题浏览:2952
  • 最近回答:2015-07-20
  • X社区推广