使用haproxy为windows远程桌面做负载均衡

公司有很多windows的服务器,因此就有了windows的跳板机机器。但是因为很多很多蛋疼的问题,造成现在直接A记录搞的经常有问题。我自己其实在测试环境测试过用haproxy做负载均衡的,比较简单。直接贴配置文件吧

  
global  
log 127.0.0.1   local0  
maxconn 40960  
pidfile /opt/haproxy/haproxy.pid  
nbproc 1  
uid 99  
gid 99  
daemon

defaults  
log     global  
mode    tcp  
option  dontlognull  
retries 3  
option redispatch  
contimeout      5000  
clitimeout      50000  
srvtimeout      50000  
listen stat  *:8000  
mode http  
option httplog  
maxconn 1000  
stats refresh 60s  
stats uri /stats  
stats realm GNUer  
stats auth admin:admin  
frontend window  
bind *:3389  
default_backend windowsrs  
backend windowsrs  
mode tcp  
balance leastconn  
server windows1 10.15.0.51:3389  weight 10  check inter 2000 rise 2 fall 4  
server windows2 10.15.1.109:3389  weight 10  check inter 2000 rise 2 fall 4  
frontend window_1  
bind *:3390  
default_backend window_rs1  
backend window_rs1  
mode tcp  
balance leastconn  
server windows1 10.15.0.51:3389  weight 10  check inter 2000 rise 2 fall 4  
frontend window_2  
bind *:3391  
default_backend window_rs2  
backend window_rs2  
mode tcp  
balance leastconn  
server windows2 10.15.1.109:3389  weight 10  check inter 2000 rise 2 fall 4  

默认的3389端口后面是有2个机器,调度算法选用最小链接数。
另外新起了2个端口,方便指定端口后能直接访问到指定的机器。

http://blog.gnuers.org/?attachment_id=331