Install Guide
3 执行以下命令来配置 HAProxy:
• 在编辑之前,使用下面的命令备份原始配置;sudo cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.original
• 现在,使用下面的命令编辑配置文件:sudo nano /etc/haproxy/haproxy.cfg
• 在配置文件中,根据需要编辑下列各部分:
– 全局部分:Maxconn <最大连接数>
– 前端 tcp-in:bind <HAProxy 服务器 IP>:5172
– 后端服务器:server <服务器别名> <Teradici 设备代理服务器 IP>:5172
– maxconn <每个 Teradici 设备代理服务器的最大连接数>
注: 为了实现高可用性,管理员可能会添加超出客户机容量总数的额外后端服务器以获得无缝的故障转移。
• 在编辑配置之后,使用命令 Ctrl + O 进行保存
• 提供的示例 HAProxy 配置如下所示:
全局
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
daemon
#maxconn is maximum allowed connections
maxconn 50000
默认值
log global
mode tcp
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
前端 tcp-in
#用您的 Linux 代理机器的 IP 替代 IP
绑定 10.150.99.102:5172
默认_后端服务器
88
配置负载平衡