【发布时间】:2017-04-19 20:22:39
【问题描述】:
HaProxy 在遇到特定的 http-status 代码时是否可以进行故障转移?
如果 tomcat 服务器本身停止/失败,我有以下通用 haproxy 代码可以正常工作。但是,当从 tomcat 也遇到 http-status 代码 502 Bad Gateway 或 500 Internal Server Error 时,我想进行故障转移。以下配置即使在任意节点遇到500、404状态码也会继续发送流量。
backend db01_replication
mode http
bind 192.168.0.1:80
server app1 10.0.0.19:8080 check inter 10s rise 2 fall 2
server app2 10.0.0.11:8080 check inter 10s rise 2 fall 2
server app3 10.0.0.13:8080 check inter 10s rise 2 fall 2
提前致谢
【问题讨论】: