HAProxy 메트릭을 확인하여 시스템 장치를 모니터링할 수 있도록 HAProxy 메트릭 통계 페이지를 구성합니다.
시작하기 전에
필요한 역할: agent_client_collector_admin
이 태스크 정보
HAProxy는 HTTP 및 TCP 요청 모두에 대한 부하 분산 및 역방향 프록시 기능을 제공합니다. HAProxy 검사는 여러 상태 검사를 연속으로 실패한 백엔드 서버를 제거하고 로드 밸런싱의 일부로 수신 트래픽을 백엔드 서버로 전송합니다.
프로시저
-
/etc/haproxy/haproxy.cfg에 있는 HAProxy 구성 파일에 액세스합니다.
-
파일의 맨 아래에 다음을 추가합니다.
listen frontend *:8080 #Haproxy
Monitoring run on port 8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats #URL for HAProxy monitoring
stats realm Haproxy\Statistics. #Title for pop up window
stats auth admin:admin #User and Password for login to the monitoring dashboard
stats admin if TRUE
default_backend backend #This is optional for monitoring backend
-
다음 명령을 실행하여 HAProxy를 다시 시작합니다.
sudo 서비스 haproxy 다시 시작
-
다음 URL에서 액세스할 수 있는 HAProxy 메트릭 통계 페이지를 확인하여 시스템의 HAProxy 메트릭을 봅니다.
http://<HAProxyServer>:8080/stats