标签:script out style service instance ica ast ati 使用
server1:192.168.237.128 VIP1:192.168.237.10
server2:192.168.237.129 VIP2:192.168.237.20
vrrp_instance VI_2 {
state BACKUP #备机
interface eth0 #网卡名称
virtual_router_id 52 #路由ID
priority 100 #优先级
authentication {
auth_type PASS
auth_pass 2222 #########
}
virtual_ipaddress {
192.168.237.20 #######VIP2
}
track_script {
chk_nginx
}
}
vrrp_instance VI_2 {
state MASTER #主机
interface eth0 #网卡名称
virtual_router_id 52 #路由ID
priority 110 #优先级
authentication {
auth_type PASS
auth_pass 2222 #########
}
virtual_ipaddress {
192.168.237.20 #######VIP2
}
track_script {
chk_nginx
}
}
分别启动 keepalivedA 和keepalivedB,查看绑定VIP情况
停止keepalivedA service keepalived stop ,KeepalivedB接替keepalivedA工作,查看B机器ip绑定情况,访问192.168.273.10正常运行
重启keepalivedA,keepalivedA恢复工作,重新绑定VIP1,keepalivedB移除VIP1,继续监听
同上,停止keepalivedB,查看keepalivedA绑定VIP情况
标签:script out style service instance ica ast ati 使用
原文地址:https://www.cnblogs.com/vincentYw/p/11765475.html