forked from mtusi2026/mtusi2026lab3
feat(lab3): HAProxy LB, stateless API replicas, X-Instance-Id, Idempotency-Key, Grade 5 Track 1
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
global
|
||||
log stdout format raw local0
|
||||
maxconn 4096
|
||||
|
||||
defaults
|
||||
mode http
|
||||
log global
|
||||
option httplog
|
||||
option dontlognull
|
||||
option redispatch
|
||||
retries 2
|
||||
timeout connect 2s
|
||||
timeout client 30s
|
||||
timeout server 30s
|
||||
timeout check 1500ms
|
||||
|
||||
resolvers docker_dns
|
||||
nameserver dns 127.0.0.11:53
|
||||
resolve_retries 3
|
||||
timeout resolve 1s
|
||||
timeout retry 1s
|
||||
hold other 2s
|
||||
hold refused 2s
|
||||
hold nx 2s
|
||||
hold timeout 2s
|
||||
hold valid 2s
|
||||
hold obsolete 2s
|
||||
|
||||
frontend http_front
|
||||
bind *:80
|
||||
default_backend api_back
|
||||
|
||||
backend api_back
|
||||
balance roundrobin
|
||||
http-reuse safe
|
||||
option httpchk
|
||||
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr Host localhost
|
||||
http-check expect status 200
|
||||
default-server inter 1s fastinter 500ms downinter 1s fall 2 rise 1 resolvers docker_dns resolve-prefer ipv4 init-addr none maxconn 256
|
||||
server-template api 1-8 api:8080 check
|
||||
@@ -0,0 +1,14 @@
|
||||
# Redis 7.4 configuration for MTUCI Lab 3 (Shared Sessions + History Cache)
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
protected-mode no
|
||||
|
||||
# Durable persistence (AOF + RDB snapshot) so cached sessions survive container restarts
|
||||
appendonly yes
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
save 60 1
|
||||
|
||||
# Memory limits
|
||||
maxmemory 128mb
|
||||
maxmemory-policy volatile-lru
|
||||
Reference in New Issue
Block a user