Haproxy外部检查错误代码255 [英] Haproxy external-check error code 255
本文介绍了Haproxy外部检查错误代码255的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对Haproxy还是很陌生,并且在外部检查方面有一种怪异的行为。
I'm quite new with Haproxy and I have a weird behavior with external check..
这是我的配置文件:
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
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
external-check
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
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
backend web-backend
balance roundrobin
option external-check
external-check path "/usr/bin:/bin:/tmp"
external-check command /bin/true
server web1 127.0.0.1:80 check
server web2 127.0.0.1:81 check
frontend http
bind *:82
mode http
default_backend web-backend
但是我得到了503,在我的日志中我得到了:
And yet I get a 503 and in my logs I got this :
...: Server web-backend/web1 is DOWN, reason: External check error, code: 255, check duration: 5ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
...: Server web-backend/web1 is DOWN, reason: External check error, code: 255, check duration: 5ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
...: Server web-backend/web2 is DOWN, reason: External check error, code: 255, check duration: 1ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
...: Server web-backend/web2 is DOWN, reason: External check error, code: 255, check duration: 1ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
...: backend web-backend has no server available!
...: backend web-backend has no server available!
检查/ bin / true如何失败并返回255?
How could the check /bin/true fail and return 255 ?
我正在运行最新的稳定版本(1.6.5)
I'm running the latest stable version (1.6.5)
谢谢!
编辑
我在Debian8上,并且使用了以下命令: https:// haproxy.debian.net/ 安装最新版本(1.6.5)
EDIT I'm on Debian8 and I used this : https://haproxy.debian.net/ to install the latest version (1.6.5)
推荐答案
原来我正在使用监狱..这是空的!因此,在监狱中没有可执行的二进制文件(chroot / var / lib / haproxy)。
Turns out I was using a jail.. Which was empty ! So there was no binary to execute in the jail (chroot /var/lib/haproxy).
这篇关于Haproxy外部检查错误代码255的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文