Инструменты пользователя

Инструменты сайта


service:haproxy

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
service:haproxy [30.07.2024 19:21] – внешнее изменение 127.0.0.1service:haproxy [27.08.2025 04:18] (текущий) – [Coturn] viacheslav
Строка 765: Строка 765:
 [[https://www.youtube.com/watch?v=CHdT3XA3JP8|HAProxy 2.6 - обзор новых функций]] [[https://www.youtube.com/watch?v=CHdT3XA3JP8|HAProxy 2.6 - обзор новых функций]]
  
 +===== Docker =====
  
 +<file bash ~/haproxy/haproxy.cfg>
 +global
 +  stats socket /tmp/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
 +  log stdout format raw local0 info
  
 +defaults
 +  mode http
 +  timeout client 10s
 +  timeout connect 5s
 +  timeout server 10s
 +  timeout http-request 10s
 +  log global
 +
 +frontend stats
 +  bind *:8404
 +  stats enable
 +  stats uri /
 +  stats refresh 10s
 +
 +frontend myfrontend
 +  bind :80
 +  default_backend webservers
 +
 +backend webservers
 +  server web1 web1:8080 check
 +  server web2 web2:8080 check
 +  server web3 web3:8080 check
 +</file>
 +
 +<code bash>
 +docker network create --driver=bridge mynetwork
 +docker run -d --name web1 --net mynetwork --hostname web1 jmalloc/echo-server
 +docker run -d --name web2 --net mynetwork --hostname web2 jmalloc/echo-server
 +docker run -d --name web3 --net mynetwork --hostname web3 jmalloc/echo-server
 +docker run -d --name haproxy --net mynetwork -v ~/haproxy:/usr/local/etc/haproxy:ro --sysctl net.ipv4.ip_unprivileged_port_start=0 -p 80:80 -p 8404:8404 haproxy:lts-alpine
 +
 +# Перечитать конфигурацию без разрыва соединений
 +docker kill -s HUP haproxy
 +
 +# Удалить тестовый стенд
 +docker rm -f web1 web2 web3 haproxy
 +docker network rm mynetwork
 +</code>
 +[[https://www.haproxy.com/blog/how-to-run-haproxy-with-docker|How to Run HAProxy With Docker (In-Depth Guide)]]\\
 +https://hub.docker.com/r/jmalloc/echo-server
 +
 +===== Coturn =====
 +> It's totally possible to run coturn behind a load balancer successfully. The problem with op's approach is that they're trying to use the wrong type of load balancer,
 +> specifically one that load-balances HTTP/S traffic (layer 7), instead of TCP/UDP (layer 4) traffic. [...] you should use a load balancer that routes UDP/TCP traffic (layer 4)
 +[[https://github.com/coturn/coturn/issues/876#issuecomment-2427353771|coTURN behind load balancer in kubernetes]]
 +
 +[[https://github.com/coturn/coturn/blob/master/README.turnserver|Документация по ключам запуска]]\\
 +https://github.com/steveseguin/vdo.ninja/blob/develop/turnserver.md\\
 +[[https://github.com/coturn/coturn/issues/882|Help configuring haproxy reverse proxy with coturn?]]\\
 +https://element-hq.github.io/synapse/latest/setup/turn/coturn.html\\
 +https://element-hq.github.io/synapse/latest/setup/turn/eturnal.html
 +
 +===== Шпаргалки =====
 +==== Части URL ====
 +|URL (absolute URI) |%%http://192.168.0.12:8080/serv/login.php?lang=en&profile=2%% |
 +|Scheme |http |
 +|Address:port |192.168.0.12:8080 |
 +|Relative URI |/serv/login.php?lang=en&profile=2 |
 +|Path (relative URI before "?") |/serv/login.php |
 +|Query string |lang=en&profile=2 |
 +
 +https://docs.haproxy.org/3.2/configuration.html#1.3.1
service/haproxy.1722367260.txt.gz · Последнее изменение: 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki