我尝试在第4层配置Haproxy负载均衡器。它可以工作。但后端服务器未通过运行状况检查。 Haproxy说它已经失败了。我该如何解决?
我必须添加吗?我试过,没有任何区别。
option httpchk HEAD /app.php HTTP/1.1\r\nHost:orocampus.tk
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
option httpchk
timeout connect 5000
timeout client 50000
timeout server 50000
frontend ft_web
bind 0.0.0.0:80
default_backend orocampus
backend orocampus
mode http
balance roundrobin
cookie SERVERID insert indirect nocache
server web1 app1.orocampus.tk:80 check cookie web1
server web2 app2.orocampus.tk:80 check cookie web2
答案 0 :(得分:1)
option httpchk HEAD /app.php HTTP/1.1\r\nHost:\ orocampus.tk
这解决了它。