<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Haproxy._RDP_Balancing</id>
	<title>Haproxy. RDP Balancing - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cless.pro/index.php?action=history&amp;feed=atom&amp;title=Haproxy._RDP_Balancing"/>
	<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Haproxy._RDP_Balancing&amp;action=history"/>
	<updated>2026-10-23T00:01:34Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.cless.pro/index.php?title=Haproxy._RDP_Balancing&amp;diff=1013&amp;oldid=prev</id>
		<title>Cless: Новая страница: «== Links == [https://habr.com/ru/post/503430/https://habr.com/ru/post/335872/https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0...»</title>
		<link rel="alternate" type="text/html" href="https://wiki.cless.pro/index.php?title=Haproxy._RDP_Balancing&amp;diff=1013&amp;oldid=prev"/>
		<updated>2022-08-23T13:23:33Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «== Links == [https://habr.com/ru/post/503430/https://habr.com/ru/post/335872/https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Links ==&lt;br /&gt;
[https://habr.com/ru/post/503430/https://habr.com/ru/post/335872/https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81-haproxy-%D0%B8-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%BE%D0%B9-%D0%BD%D0%B0%D0%B3%D1%80.html https://habr.com/ru/post/503430/]&lt;br /&gt;
&lt;br /&gt;
[https://habr.com/ru/post/503430/https://habr.com/ru/post/335872/https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81-haproxy-%D0%B8-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%BE%D0%B9-%D0%BD%D0%B0%D0%B3%D1%80.html https://habr.com/ru/post/335872/]&lt;br /&gt;
&lt;br /&gt;
[https://habr.com/ru/post/503430/https://habr.com/ru/post/335872/https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81-haproxy-%D0%B8-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%BE%D0%B9-%D0%BD%D0%B0%D0%B3%D1%80.html https://kuzevanov.ru/linux/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D1%8B-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81-haproxy-%D0%B8-%D0%B1%D0%B0%D0%BB%D0%B0%D0%BD%D1%81%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%BE%D0%B9-%D0%BD%D0%B0%D0%B3%D1%80.html]&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
Balancing rdp clients via haproxy (RDP) to several RDP server&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
     User (Client RDP)&lt;br /&gt;
             ↓&lt;br /&gt;
         Internet&lt;br /&gt;
             ↓&lt;br /&gt;
       HAProxy (RDP)&lt;br /&gt;
         ↓       ↓&lt;br /&gt;
 RDP Server1   RDP Server2&lt;br /&gt;
         ↓      ↓&lt;br /&gt;
         DATABASE&lt;br /&gt;
&amp;lt;code&amp;gt;yum install haproxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.ORIG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;nano /etc/haproxy/haproxy.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
 #---------------------------------------------------------------------&lt;br /&gt;
 # Global settings&lt;br /&gt;
 #---------------------------------------------------------------------&lt;br /&gt;
 global&lt;br /&gt;
     # to have these messages end up in /var/log/haproxy.log you will&lt;br /&gt;
     # need to:&lt;br /&gt;
     #&lt;br /&gt;
     # 1) configure syslog to accept network log events.  This is done&lt;br /&gt;
     #    by adding the '-r' option to the SYSLOGD_OPTIONS in&lt;br /&gt;
     #    /etc/sysconfig/syslog&lt;br /&gt;
     #&lt;br /&gt;
     # 2) configure local2 events to go to the /var/log/haproxy.log&lt;br /&gt;
     #   file. A line like the following can be added to&lt;br /&gt;
     #   /etc/sysconfig/syslog&lt;br /&gt;
     #&lt;br /&gt;
     #    local2.*                       /var/log/haproxy.log&lt;br /&gt;
     #&lt;br /&gt;
     log         127.0.0.1 local2&lt;br /&gt;
     chroot      /var/lib/haproxy&lt;br /&gt;
     pidfile     /var/run/haproxy.pid&lt;br /&gt;
     maxconn     4000&lt;br /&gt;
     user        haproxy&lt;br /&gt;
     group       haproxy&lt;br /&gt;
     daemon&lt;br /&gt;
     # turn on stats unix socket&lt;br /&gt;
     stats socket /var/lib/haproxy/stats&lt;br /&gt;
 #---------------------------------------------------------------------&lt;br /&gt;
 # common defaults that all the 'listen' and 'backend' sections will&lt;br /&gt;
 # use if not designated in their block&lt;br /&gt;
 #---------------------------------------------------------------------&lt;br /&gt;
 defaults&lt;br /&gt;
     mode                    http&lt;br /&gt;
     log                     global&lt;br /&gt;
     option                  httplog&lt;br /&gt;
     option                  dontlognull&lt;br /&gt;
     option http-server-close&lt;br /&gt;
     option forwardfor       except 127.0.0.0/8&lt;br /&gt;
     option                  redispatch&lt;br /&gt;
     retries                 3&lt;br /&gt;
     timeout http-request    10s&lt;br /&gt;
     timeout queue           1m&lt;br /&gt;
     timeout connect         10s&lt;br /&gt;
     timeout client          1m&lt;br /&gt;
     timeout server          1m&lt;br /&gt;
     timeout http-keep-alive 10s&lt;br /&gt;
     timeout check           10s&lt;br /&gt;
     maxconn                 3000&lt;br /&gt;
 #####&lt;br /&gt;
 frontend fr_rdp&lt;br /&gt;
   mode tcp&lt;br /&gt;
   &lt;br /&gt;
   # LISTEN RDP PORT OF HAPROXY SERVER&lt;br /&gt;
   bind *:3389 name rdp&lt;br /&gt;
   &lt;br /&gt;
   log global&lt;br /&gt;
   option tcplog&lt;br /&gt;
   tcp-request inspect-delay 2s&lt;br /&gt;
   tcp-request content accept if RDP_COOKIE&lt;br /&gt;
   default_backend BK_RDP&lt;br /&gt;
 backend BK_RDP&lt;br /&gt;
   mode tcp&lt;br /&gt;
   balance leastconn&lt;br /&gt;
   timeout server 5s&lt;br /&gt;
   timeout connect 4s&lt;br /&gt;
   log global&lt;br /&gt;
   option tcplog&lt;br /&gt;
   stick-table type string len 32 size 10k expire 8h&lt;br /&gt;
   &lt;br /&gt;
   ### TABLE WITH USERS DEPENDS ON USERNAME IN rdp_cookie OF CLIENT&lt;br /&gt;
   stick on rdp_cookie(mstshash)&lt;br /&gt;
     ### -OR-&lt;br /&gt;
   ### TABLE WITH USERS DEPENDS ON src-ip OF CLIENT&lt;br /&gt;
   # stick on src&lt;br /&gt;
   option tcp-check&lt;br /&gt;
   tcp-check connect port 3389&lt;br /&gt;
   default-server inter 3s rise 2 fall 3&lt;br /&gt;
   &lt;br /&gt;
   # SERVERS RDP FOR BALANCING&lt;br /&gt;
   server TS01 192.168.199.36:3389 weight 10 check&lt;br /&gt;
   server TS02 192.168.199.37:3389 weight 20 check&lt;br /&gt;
 listen stats&lt;br /&gt;
  bind *:9000&lt;br /&gt;
  mode http&lt;br /&gt;
  stats enable&lt;br /&gt;
  #stats hide-version&lt;br /&gt;
  stats show-node&lt;br /&gt;
  stats realm Haproxy\ Statistics&lt;br /&gt;
  stats uri /&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl restart haproxy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;systemctl status haproxy&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Категория:Haproxy]]&lt;br /&gt;
__ОБЯЗАТЕЛЬНОЕ_ОГЛАВЛЕНИЕ__&lt;/div&gt;</summary>
		<author><name>Cless</name></author>
	</entry>
</feed>