From: Kai Moritz Date: Sun, 15 Jan 2023 18:16:09 +0000 (+0100) Subject: feat: Added a default backend, that picks the server randomly X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=236e6d115fb0c0d1ab54ea8e6acd31fad04986ee;p=demos%2Fkafka%2Fchat feat: Added a default backend, that picks the server randomly --- diff --git a/haproxy.cfg b/haproxy.cfg index 0dd9ac52..2177daa2 100644 --- a/haproxy.cfg +++ b/haproxy.cfg @@ -19,8 +19,14 @@ frontend stats frontend frontend bind :8400 + default_backend random use_backend %[req.hdr(X-Shard),map(/usr/local/etc/haproxy/sharding.map)] +backend random + server b1 backend-1:8080 check + server b2 backend-2:8080 check + server b3 backend-3:8080 check + backend backend_1 server b1 backend-1:8080 check