keepalived 主从配置文件
master IP:192.168.207.128
master配置文件如下
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id lb01
}
vrrp_instance VI_1 {
state MASTER //主模式
interface eth0
virtual_router_id 51
priority 100
unicast_src_ip 192.168.207.128 #本机IP
unicast_peer {
192.168.207.129 #从机IP
}
从机IP:192.168.127.129
! Configuration File for keepalived
global_defs {
notification_email {
acassen@firewall.loc
failover@firewall.loc
sysadmin@firewall.loc
}
notification_email_from Alexandre.Cassen@firewall.loc
smtp_server 192.168.200.1
smtp_connect_timeout 30
router_id lb02
}
vrrp_instance VI_1 {
state BACKUP //从模式
interface eth0
virtual_router_id 51
priority 51
unicast_src_ip 192.168.207.129
unicast_peer {
192.168.207.128
}