I have a flat network (no routing yet) of 3 servers, each with a service (http, mysqld, doesn't matter) listening on 0.0.0.0 (ip_nonlocal_bind and ip_forward are on) and running keepalived.
virtual_server 10.0.0.80 3306 {
delay_loop 2
lb_algo rr
lb_kind DR
protocol TCP
real_server 10.0.0.81 3306 {
weight 10
TCP_CHECK {
connect_timeout 1
}
}
real_server 10.0.0.82 3306 {
weight 10
TCP_CHECK {
connect_port 3306
connect_timeout 1
}
}
real_server 10.0.0.83 3306 {
weight 10
TCP_CHECK {
connect_port 3306
connect_timeout 1
}
}
}
keepalived (as the service) is working and failing to each box as appropriate. However, the virtual_server is only serving pages (or database queries, or whatever) from the box keepalived currently has the IP on, they fail the other 2/3 of the time (weighted evenly).
Example: When BOX1 has the keepalived address, requests will WORK, FAIL, FAIL, repeat, it only answers with "box1". When BOX2 as the keepalived address, requests will FAIL, WORK, FAIL, only answering as "box2".
I am convinced the non-keepalived IP boxes are refusing to answer the query because they do not own or do not know they should be answering as the keepalived IP. How do I get the non-keepalived boxes to answer always?
This is not my first keepalived setup, but this is my first virtual_server setup. I just need a load balancer, I do not need high availability provided by HAProxy.