I have a keepalived setup with three servers behind an ip. One is setup as a sorry server and only serves the maintenance pages, the other two are actual app servers. We would like it setup so that traffic only routes to the one server until it goes down and then have the other server take the traffic, until the primary one comes back online.
Leaving out lb_algo causes this error and keepalived refusing to start
Jan 23 17:15:22 fw001 kernel: IPVS: Scheduler module ip_vs_ not found
And the only options for lb_algo are:
rr|wrr|lc|wlc|lblc|sh|dh
Which all load balance across the active servers in some fashion.
Config example
virtual_server 203.0.113.0 80 {
delay_loop 60
lb_algo wrr
lb_kind NAT
nat_mask 255.255.255.0
persistence_timeout 50
protocol TCP
sorry_server 10.0.0.3 8080
real_server 10.0.0.1 8080 {
weight 100
HTTP_GET {
url {
path /alive
digest 7a13a825b31584fe9b135ab53974d893
}
connect_timeout 30
nb_get_retry 30
delay_before_retry 10
}
}
real_server 10.0.0.2 8080 {
weight 0
HTTP_GET {
url {
path /alive
digest 7a13a825b31584fe9b135ab53974d893
}
connect_timeout 30
nb_get_retry 30
delay_before_retry 10
}
}
}
Is there any way to do this?