Dual mode master keepalived
The main principle, a vip on a keepalived machine is matser role, and the other is the role of backup. There are a number of different vrrp_instance only on a single machine. When a plurality of vip, reducing the pressure of a single keepalived
192.168.1.106 on the configuration:
Above there is a master 192.168.7.248 backup192.168.7.249
192.168.1.107 on the configuration:
There above a master 192.168.7.249 backup192.168.7.248
Note: with a vip, virtual_route_id same. With a profile vrrp_instance name can not conflict. And "{" before there is a space, otherwise it will error
Configuration 106
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 50
priority 100
advert_int 1
unicast_src_ip 192.168.1.106
unicast_peer {
192.168.1.107
}
authentication {
auth_type PASS
auth_pass 1111qwer
}
virtual_ipaddress {
192.168.7.248/24 dev eth0 label eth0:1
}
}
vrrp_instance VI_2 {
state BACKUP
interface eth0
virtual_router_id 51
priority 70
advert_int 1
unicast_src_ip 192.168.1.106
unicast_peer {
192.168.1.107
}
authentication {
auth_type PASS
auth_pass 1111qwer
}
virtual_ipaddress {
192.168.7.249/24 dev eth0 label eth0:2
}
}
107 arranged on:
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 50
priority 80
advert_int 1
unicast_src_ip 192.168.1.107
unicast_peer {
192.168.1.106
}
authentication {
auth_type PASS
auth_pass 1111qwer
}
virtual_ipaddress {
192.168.7.248/24 dev eth0 label eth0:1
}
}
vrrp_instance VI_2 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
advert_int 1
unicast_src_ip 192.168.1.107
unicast_peer {
192.168.1.106
}
authentication {
auth_type PASS
auth_pass 1111qwer
}
virtual_ipaddress {
192.168.7.249/24 dev eth0 label eth0:2
}
}