Rootop 服务器运维与web架构

keepalived从机接管后主机恢复不抢占VIP

| 暂无评论

在lvs+keepalived环境中,为了减小keepalived主从切换带来的意外风险,设置主机恢复后不抢占VIP。
待进行vrrp协议通告备机不可用时切换。主要修改两个地方。(红色部分)

只需修改主服务器state MASTER改为state BACKUP并添加nopreempt

! Configuration File for keepalived

global_defs {
notification_email {
acassen@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server localhost
smtp_connect_timeout 30
router_id mfs_master
}

vrrp_instance VI_1 {
state BACKUP
interface eth1
virtual_router_id 51
priority 100
nopreempt
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
192.168.0.11
}
}

拔线测试即可。

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/2350.html

作者:Venus

服务器运维与性能优化

发表回复