2016-05-24 9 views
0

haproxy 1.5で正常性状態を確認する際に問題があります。 サンプルバックエンドまたはサンプルバックエンド2では、haproxyはtcpモードでステータスをチェックしませんが、tcpモードを指定しても常にL7モードをチェックします。それは常にUPです。ここでHaproxyがtcpモードでバックエンドをチェックしない

は私の設定です:

global 
log   127.0.0.1 local2 
chroot  /var/lib/haproxy 
pidfile  /var/run/haproxy.pid 
maxconn  4000 
user  haproxy 
group  haproxy 
daemon 
defaults 
mode     tcp 
log      global 
option     httplog 
option     dontlognull 
option http-server-close 
option forwardfor  except 127.0.0.0/8 
option     redispatch 
retries     3 
timeout http-request 10s 
timeout queue   1m 
timeout connect   10s 
timeout client   1m 
timeout server   1m 
timeout http-keep-alive 10s 
timeout check   10s 
maxconn     3000 

frontend haproxy_in 
    mode http 
    bind 172.25.0.33:80 
    option forwardfor header X-Real-IP 

    acl host_static hdr_beg(host) -i sample. 
    use_backend sample-backend if host_static 

    acl host_static hdr_beg(host) -i af-ws. 
    use_backend sample-backend if host_static 

    default_backend haproxy_http 

frontend haproxy_in_htpps 
    bind 172.25.0.33:443 
    mode tcp 
    use_backend haproxy_https 

backend haproxy_https 
    balance roundrobin 

    mode tcp 
    option httpchk OPTIONS /manager/html 
    http-check expect status 401 
    option forwardfor 
    server web1 172.25.0.35:443 check addr 172.25.0.35 port 8085 inter 5000 
    server web2 172.25.0.36:443 check addr 172.25.0.36 port 8085 inter 5000 

backend haproxy_http 
    balance roundrobin 
    mode http 

    option httpchk 
    option forwardfor 
    server web1 172.25.0.35:80 check 
    server web2 172.25.0.36:80 check backup 

backend sample-backend 
    mode http 
    balance roundrobin 
#  option httpchk get /?action=Ping 
#  option forwardfor 
    option tcp-check 
#  server web4 172.25.0.38:80 check addr 172.25.0.38 port 8888 inter 5000 
#  server web3 172.25.0.37:80 check addr 172.25.0.37 port 8888 inter 5000 
    server test 10.41.41.240:8888 check addr 10.41.41.240 port 8888 inter 5000 
    server test1 172.25.0.37:9999 check addr 172.25.0.37 port 9999 inter 5000 

backend sample-backend2 
    mode tcp 
    balance roundrobin 
#  option httpchk get /?action=Ping 
#  option forwardfor 
    option tcp-check 
#  server web4 172.25.0.38:80 check addr 172.25.0.38 port 8888 inter 5000 
#  server web3 172.25.0.37:80 check addr 172.25.0.37 port 8888 inter 5000 
    server test2 10.41.41.240:8888 check addr 10.41.41.240 port 8888 inter 5000 
    server test3 172.25.0.37:9999 check addr 172.25.0.37 port 9999 inter 5000 

どこに間違いはありますか?ありがとう!

答えて

0

私のバージョンは1.5.4だったので、tcpcheckにバグがあります。最新バージョンにアップデートすれば動作します。

関連する問題