使用 HAProxy 和 Keepalived 与仅使用 Keepalived 的优势

Advantage of using HAProxy AND Keepalived vs just Keepalived

根据(详细)主题,使用 KeepalivedHAProxy 作为 HA 网络服务器 loadbalancer 与纯 keepalived 解决方案相比有什么优势吗?

Keepalived 在第 4 层工作,所以根本不知道第 7 层。通过一起使用 HAProxy 和 Keepalived,您可以受益于 HAProxy 在第 7 层提供的一些选项,例如 Stickiness, Sampling and converting information, ACLs and conditions, Content switching, Stick-tables, Formated strings, HTTP rewriting and redirection, Server protection, etc

如果您只需要一个负载均衡器而不需要任何操作或任何高层决策(第 7 层),您可以只使用 Keepalived,它会更快,因为它在第 4 层工作。