首页 > 解决方案 > HAProxy 2.0.6-1~bpo9+1 服务器健康检查失败,原因:第四层超时

问题描述

我将haproxyfrom version升级1.7.5.22.0.6-1~bpo9+1on debian;相同的配置显示服务器关闭,日志显示以下错误:

“服务器健康检查失败,原因:Layer4 超时”

如果我从服务器中删除“检查”选项,它会按预期工作,但统计页面以灰色显示服务器

配置文件:

global
        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin
        stats timeout 30s
        user haproxy
        group haproxy
        daemon
        maxconn     50000

        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        tune.ssl.default-dh-param 2048
        ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:D$
        ssl-default-bind-options no-sslv3


defaults
    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option  log-health-checks
    option http-server-close
    option forwardfor       except 127.0.0.0/8
    option                  redispatch
    option                  forwardfor
    retries                 3
    timeout http-request    60s
    timeout queue           1m
    timeout connect         60s
    timeout client          10m
    timeout server          10m
    timeout http-keep-alive 60s
    timeout check           60s
    maxconn                 30000

        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http


listen HAProxyLocalStats
        bind *:2267 name localstats
        mode http
        stats enable
        stats refresh 10
        stats admin if TRUE
        stats uri /haproxy
        stats auth admin:admin
        timeout client 5000
        timeout connect 5000
        timeout server 5000

frontend FrontNginx
        bind                    *:80
        mode                    http
        log                     global
        capture request header X-Forwarded-For len 500
        maxconn                 30000
        default_backend         nginxFarm


#-----------------------------------------------------------------------

backend nginxFarm
        mode                    http
        balance                 leastconn
        timeout connect         30000
        retries                 3
        option                  forwardfor
        server                  WEB01 10.20.10.19:80 check inter 5000
        server                  WEB02 10.20.10.20:80 check inter 5000

标签: timeouthaproxy

解决方案


推荐阅读