I'm playing around with keepalived and running that setup on my master node:
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass XXXXXXXXXXXXXXXXXXXXXXXXX
}
virtual_ipaddress {
192.168.178.200/32 dev eth0
192.168.178.201/32 dev eth0
}
}
virtual_server 192.168.178.201 8443 {
delay_loop 10
protocol TCP
lb_algo rr
lb_kind DR
real_server 192.168.178.210 8443 {
weight 1
TCP_CHECK {
connect_timeout 5
}
}
real_server 192.168.178.211 8443 {
weight 1
TCP_CHECK {
connect_timeout 5
}
}
real_server 192.168.178.212 8443 {
weight 1
TCP_CHECK {
connect_timeout 5
}
}
}
On the slave nodes I have the same setup with lower priority
and state BACKUP
.
For test reasons 2 of 3 nodes are offline and I would expect that the VIP (.201
) balances the traffic to 192.168.178.211:8443
. (.212
and 213
is offline, .211
is online)
I'm faced to the behaviour that 192.168.178.201:8443
is only available if the MASTER node is the same machine as the available backend machine.
In my case that means, that 192.168.178.211:8443
is only reachable if 192.168.178.211
is the MASTER node. If i.e. 192.168.178.212
is the MASTER node the traffic is not routed to 192.168.178.211:8443
.
sysctl.conf:
#keepalived
net.ipv4.ip_nonlocal_bind=1
net.ipv4.ip_forward=1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.rp_filter = 2
Who can help me on that?