diff --git a/examples/cluster/haproxy.cfg b/examples/cluster/haproxy.cfg index a9ec3c2a..ac1d1048 100644 --- a/examples/cluster/haproxy.cfg +++ b/examples/cluster/haproxy.cfg @@ -34,16 +34,25 @@ defaults errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http -frontend local_zot - bind 127.0.0.1:8080 +frontend zot + bind *:8080 mode http - default_backend my_zots + acl write_methods method POST PATCH DELETE PUT + use_backend zot-stick-writes if write_methods + default_backend zot-reads -backend my_zots +backend zot-stick-writes mode http balance leastconn - stick-table type ip size 1m expire 1h + stick-table type ip size 1m expire 30m stick on src server zot1 127.0.0.1:8081 check - server zot2 127.0.0.1:8081 check - server zot3 127.0.0.1:8082 check + server zot2 127.0.0.1:8082 check + server zot3 127.0.0.1:8083 check + +backend zot-reads + mode http + balance roundrobin + server zot1 127.0.0.1:8081 check + server zot2 127.0.0.1:8082 check + server zot3 127.0.0.1:8083 check