Referenciando estes dois guias:
Tentando obter o virtual_ipaddress com o valor salarial funcionando em um nível muito básico em um par de instâncias do AWS. Eles são implantados exatamente na mesma zona em um VPC, e o VRRP parece estar fluindo entre eles, mas eles não parecem estar prontos para baixar para o estado BACKUP!
Servidor A ("MASTER"):
Configuração:
vrrp_instance VI_1 {
debug 2
interface eth0
state MASTER
virtual_router_id 51
priority 101
unicast_src_ip 172.31.13.67
unicast_peer {
172.31.14.193
}
virtual_ipaddress {
172.31.100.100 dev eth0
}
}
Relevante / var / log / messages no Servidor A:
Aug 26 23:32:41 Server A systemd: Started LVS and VRRP High Availability Monitor.
Aug 26 23:32:41 Server A Keepalived_healthcheckers[1041]: Opening file '/etc/keepalived/keepalived.conf'.
Aug 26 23:32:41 Server A Keepalived_healthcheckers[1041]: Configuration is using : 5139 Bytes
Aug 26 23:32:41 Server A Keepalived_vrrp[1042]: Opening file '/etc/keepalived/keepalived.conf'.
Aug 26 23:32:41 Server A Keepalived_vrrp[1042]: Configuration is using : 60780 Bytes
Aug 26 23:32:41 Server A Keepalived_vrrp[1042]: Using LinkWatch kernel netlink reflector...
Aug 26 23:32:41 Server A Keepalived_vrrp[1042]: VRRP sockpool: [ifindex(2), proto(112), unicast(1), fd(10,11)]
Aug 26 23:32:41 Server A Keepalived_healthcheckers[1041]: Using LinkWatch kernel netlink reflector...
Aug 26 23:32:42 Server A Keepalived_vrrp[1042]: VRRP_Instance(VI_1) Transition to MASTER STATE
Aug 26 23:32:43 Server A Keepalived_vrrp[1042]: VRRP_Instance(VI_1) Entering MASTER STATE
Aug 26 23:32:43 Server A Keepalived_vrrp[1042]: VRRP_Instance(VI_1) setting protocol VIPs.
Aug 26 23:32:43 Server A Keepalived_vrrp[1042]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 172.31.100.100
Aug 26 23:32:43 Server A Keepalived_healthcheckers[1041]: Netlink reflector reports IP 172.31.100.100 added
Aug 26 23:32:48 Server A Keepalived_vrrp[1042]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 172.31.100.100
tcpdump "ip proto 112":
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
23:36:48.823269 IP ip-172-31-13-67.us-west-2.compute.internal > ip-172-31-14-193.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 101, authtype none, intvl 1s, length 20
23:36:49.824407 IP ip-172-31-13-67.us-west-2.compute.internal > ip-172-31-14-193.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 101, authtype none, intvl 1s, length 20
23:36:50.825530 IP ip-172-31-13-67.us-west-2.compute.internal > ip-172-31-14-193.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 101, authtype none, intvl 1s, length 20
23:36:51.826660 IP ip-172-31-13-67.us-west-2.compute.internal > ip-172-31-14-193.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 101, authtype none, intvl 1s, length 20
23:36:52.827798 IP ip-172-31-13-67.us-west-2.compute.internal > ip-172-31-14-193.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 101, authtype none, intvl 1s, length 20
Servidor B ("BACKUP"):
Configuração:
vrrp_instance VI_1 {
debug 2
interface eth0
state BACKUP
virtual_router_id 51
priority 100
unicast_src_ip 172.31.14.193
unicast_peer {
172.31.13.67
}
virtual_ipaddress {
172.31.100.100 dev eth0
}
}
Relevante / var / log / messages / no servidor B:
Aug 26 23:13:20 Server B systemd: Started LVS and VRRP High Availability Monitor.
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Netlink reflector reports IP 172.31.14.193 added
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Netlink reflector reports IP fe80::839:ffff:fe8f:db75 added
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Registering Kernel netlink reflector
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Registering Kernel netlink command channel
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Registering gratuitous ARP shared channel
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Netlink reflector reports IP 172.31.14.193 added
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Netlink reflector reports IP fe80::839:ffff:fe8f:db75 added
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Registering Kernel netlink reflector
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Registering Kernel netlink command channel
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Opening file '/etc/keepalived/keepalived.conf'.
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Configuration is using : 60782 Bytes
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: Using LinkWatch kernel netlink reflector...
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) Entering BACKUP STATE
Aug 26 23:13:20 Server B Keepalived_vrrp[11498]: VRRP sockpool: [ifindex(2), proto(112), unicast(1), fd(10,11)]
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Opening file '/etc/keepalived/keepalived.conf'.
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Configuration is using : 5141 Bytes
Aug 26 23:13:20 Server B Keepalived_healthcheckers[11497]: Using LinkWatch kernel netlink reflector...
Aug 26 23:13:23 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) Transition to MASTER STATE
Aug 26 23:13:24 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) Entering MASTER STATE
Aug 26 23:13:24 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) setting protocol VIPs.
Aug 26 23:13:24 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 172.31.100.100
Aug 26 23:13:24 Server B Keepalived_healthcheckers[11497]: Netlink reflector reports IP 172.31.100.100 added
Aug 26 23:13:29 Server B Keepalived_vrrp[11498]: VRRP_Instance(VI_1) Sending gratuitous ARPs on eth0 for 172.31.100.100
Aug 26 23:15:30 Server B kernel: device eth0 entered promiscuous mode
Aug 26 23:15:35 Server B kernel: device eth0 left promiscuous mode
tcpdump "ip proto 112":
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
23:37:03.060867 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
23:37:04.062044 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
23:37:05.063169 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
23:37:06.064375 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
23:37:07.065562 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
23:37:08.066790 IP ip-172-31-14-193.us-west-2.compute.internal > ip-172-31-13-67.us-west-2.compute.internal: VRRPv2, Advertisement, vrid 51, prio 100, authtype none, intvl 1s, length 20
Tenho a sensação de que provavelmente estou fazendo algo muito básico muito errado, mas já passei por uma dúzia de iterações de arquivos de configuração e agora estou tentando fazer tudo no nível mais 'burro' . Eu quero reiniciar o "MASTER" e ter o "BACKUP" pegar a mudança, mas em vez disso, ele entra no estado "FAULT", ou aleatoriamente não faz absolutamente nada ...