ЛР 5: асинхронная обработка изображений, уровень 5

This commit is contained in:
Nurlygayanova Ekaterina
2026-11-12 20:32:55 +03:00
parent 276dbdad8a
commit 7b3eab5473
115 changed files with 8847 additions and 34 deletions
+54
View File
@@ -0,0 +1,54 @@
global
log stdout format raw local0 info
resolvers docker
nameserver dns 127.0.0.11:53
accepted_payload_size 8192
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 5s
hold obsolete 5s
defaults
mode http
log global
option httplog
option dontlognull
retries 2
retry-on conn-failure
option redispatch 1
timeout connect 500ms
timeout client 30s
timeout server 15s
timeout http-request 10s
timeout http-keep-alive 30s
timeout queue 5s
timeout check 1500ms
# Ответы самого LB в формате контракта: схема Error и X-Request-Id, совпадающий с request_id.
# Контракт разрешает таким ответам не иметь X-Instance-Id. Ответы реплик эти правила не меняют.
http-error status 502 content-type application/json hdr X-Request-Id "%[var(txn.request_id)]" lf-string '{"error":{"code":"unavailable","message":"Service temporarily unavailable","request_id":"%[var(txn.request_id)]"}}'
http-error status 503 content-type application/json hdr X-Request-Id "%[var(txn.request_id)]" lf-string '{"error":{"code":"unavailable","message":"Service temporarily unavailable","request_id":"%[var(txn.request_id)]"}}'
http-error status 504 content-type application/json hdr X-Request-Id "%[var(txn.request_id)]" lf-string '{"error":{"code":"unavailable","message":"Service temporarily unavailable","request_id":"%[var(txn.request_id)]"}}'
frontend public
bind :8080
# Идентификатор для ответов самого LB. У ответов реплик свой X-Request-Id.
http-request set-var(txn.request_id) uuid()
default_backend api
backend api
balance roundrobin
option httpchk GET /health/ready
http-check expect status 200
default-server check init-state down inter 1s fall 2 rise 2 observe layer4 error-limit 2 on-error mark-down resolvers docker init-addr none resolve-prefer ipv4
server-template api 1-8 api:8080
frontend stats
bind 127.0.0.1:8404
monitor-uri /health
stats enable
stats uri /stats
+37
View File
@@ -0,0 +1,37 @@
# Единственный путь к SeaweedFS из сети стенда: пропускает только порт S3 (9000).
# Нужен потому, что флаг -s3.ip.bind открывает на всех интерфейсах и служебный gRPC-порт шлюза 19000,
# отдельно его не закрыть. Сам SeaweedFS находится во внутренней сети, куда входит только этот шлюз.
# Режим TCP: подпись S3 проверяет сервер, заголовок Host не меняется.
global
log stdout format raw local0 warning
resolvers docker
nameserver dns 127.0.0.11:53
hold valid 2s
hold obsolete 2s
timeout resolve 1s
timeout retry 1s
defaults
log global
timeout connect 1s
# Больше передачи файла в API (60 с).
timeout client 90s
timeout server 90s
frontend s3
mode tcp
bind :9000
default_backend storage
backend storage
mode tcp
# Имя s3-storage существует только во внутренней сети. После перезапуска адрес определяется заново.
default-server check inter 1s fall 2 rise 1 init-addr none resolvers docker resolve-prefer ipv4
server s3 s3-storage:9000
frontend health
mode http
bind 127.0.0.1:8405
monitor-uri /health
+4
View File
@@ -0,0 +1,4 @@
# Allocate one volume at a time for this single-node teaching setup.
# The default batch of seven quickly exhausts volume slots across buckets.
[master.volume_growth]
copy_1 = 1