
HAProxy에 대한 통계를 설정하는 방법을 알 수 없습니다.
내 구성은 다음과 같습니다.
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
daemon
#debug
user haproxy
group haproxy
maxconn 4096
stats socket /tmp/haproxy
defaults
log global
mode tcp
option tcplog
option dontlognull
option redispatch
option clitcpka
option srvtcpka
option tcpka
retries 3
maxconn 2000
contimeout 10000
clitimeout 50000
srvtimeout 50000
stats enable
stats hide-version
stats scope .
stats realm Haproxy\ Statistics
stats uri /haproxy?stats
stats auth xxxxx:xxxxx
option contstats
listen rtmp :1935
mode tcp
balance roundrobin
server s1 xxx.xxx.xxx.xxx:1935 check
server s2 xxx.xxx.xxx.xxx:1935 check
내가 이해하는 한, 매뉴얼을 통해 통계 페이지를 이용할 수 있어야 합니다.http://mysite/haproxy?stats. 내가 무엇을 놓치고 있나요?
편집하다:socat을 사용하여 통계에 액세스할 수 있지만~ 아니다웹 브라우저로.
답변1
그것은 정확하지 않습니다. 통계 페이지가 있을 것입니다.http://yoursite.com:1935/haproxy?stats
이 문제를 극복하려면 다른 청취자를 추가하십시오.
listen stats
bind :1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth Username:Password
그런 다음http://yoursite.com:1936/그리고 로그인하세요.
방화벽이 포트 1936에서 이 요청을 차단하지 않는지 확인하세요(원하는 대로 변경할 수 있음).
listen stats
사용자 제안에 따라 최신 버전의 HAProxy에 대해 바인딩을 블록 으로 옮겼습니다.
답변2
이것은 나를 위해 해냈습니다:
listen stats
bind :9000
또는
listen stats
bind 10.100.86.150:9000
답변3
haproxy의 새 버전(>1.6)에서는 (기본값) http
대신 모드를 다음으로 설정해야 합니다.tcp
config : 'stats' statement ignored for frontend 'http-in' as it requires HTTP mode.
답변4
예를 들어 바인딩*:80 과 같은 스크립트를 추가해야 bind *:port
하거나 별표 기호를 공용 IP 또는 컴퓨터의 IP가 설치된 것으로 바꿀 수 있습니다.
제 제안에 따르면 통계 스크립트를 하나의 프런트엔드로 이동하거나 하나의 프런트엔드를 추가하여 통계에 비공개로 액세스할 수 있습니다.