forked from mtusi2026/mtusi2026lab3
Лабораторная 3: реализован стенд с балансировщиком и идемпотентностью
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# HAProxy configuration for MTUSI Messenger Lab 3
|
||||
# Single public entrypoint on port 8080, round-robin across API replicas,
|
||||
# active health checks against /health/live (fast liveness), LB removes dead backends.
|
||||
|
||||
global
|
||||
maxconn 2000
|
||||
log stdout format raw local0
|
||||
|
||||
defaults
|
||||
mode http
|
||||
timeout connect 10s
|
||||
timeout client 30s
|
||||
timeout server 30s
|
||||
timeout check 2s
|
||||
option httplog
|
||||
option dontlognull
|
||||
|
||||
frontend http_front
|
||||
bind *:8080
|
||||
default_backend api_back
|
||||
|
||||
backend api_back
|
||||
balance roundrobin
|
||||
option httpchk GET /health/ready
|
||||
http-check expect status 200
|
||||
option http-server-close
|
||||
default-server inter 1s fall 2 rise 2
|
||||
server api-1 api-1:8080 check
|
||||
server api-2 api-2:8080 check
|
||||
server api-3 api-3:8080 check
|
||||
server api-4 api-4:8080 check
|
||||
|
||||
# Stats endpoint for debugging
|
||||
listen stats
|
||||
bind *:8404
|
||||
stats enable
|
||||
stats uri /stats
|
||||
stats refresh 10s
|
||||
|
||||
Reference in New Issue
Block a user