How To Configure HA Proxy Load Balancer With EFT Server HA Cluster
How To Configure HA Proxy Load Balancer With EFT Server HA Cluster
This article provides the steps and some configuration samples for a HAProxy running on CentOS/REHL
that can be used to load balance N number of nodes of an EFT in High Availability mode for inbound
connections.
Disclaimer:
This article it is intended for technical audience and it is provided “As Is” without any guaranty or
support; it is intended for demonstration/educational purposes only. Globalscape recommends using a
hardware-based load balancer like Big IP F5 or similar for production environments. Additionally,
HAProxy it is open source and should be considered at customer's discretion. Please consult with your
Network Administrator or Globalscape Tech Support for more information.
Prerequisites
HAProxy requires all nodes clocks to be synchronized so you will need to enable ntpd on each node:
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/init.d/ntpd start
CentOS/RHEL 5 , 32 bit:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-
4.noarch.rpm
CentOS/RHEL 5 , 64 bit:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-
4.noarch.rpm
CentOS/RHEL 6 , 32 bit:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-
8.noarch.rpm
CentOS/RHEL 6 , 64 bit:
# rpm -Uvh
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Page 2 of 8
Step2. Install HAProxy using Yum
Install HAproxy package using following command
Page 3 of 8
# /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 45000
user haproxy
group haproxy
daemon
nbproc 1
Page 4 of 8
maxconn 4096
### Each of these frontends represent a server and its corresponding PASV
ports
frontend ftp-server1
bind *:28000-30000
default_backend eft_server1
### Each of these frontends represent a server and its corresponding PASV
ports
frontend ftp-server2
bind *:30001-32000
default_backend eft_server2
### Each of these frontends represent a server and its corresponding PASV
ports
frontend ftp-server3
bind *:32001-34000
default_backend eft_server3
### Global backend for the FTP control traffic to find a server
Page 5 of 8
backend ftp_server_pool
server eft-server1 192.168.105.125 check port 21 inter 10s rise 1 fall
2
server eft-server2 192.168.105.126 check port 21 inter 10s rise 1 fall
2
server eft-server3 192.168.105.127 check port 21 inter 10s rise 1 fall
2
### Global backend for the FTPS (Implicit) control traffic to find a
server
backend ftps_server_pool
server eft-server1 192.168.105.125 check port 990 inter 10s rise 1 fall
2
server eft-server2 192.168.105.126 check port 990 inter 10s rise 1 fall
2
server eft-server3 192.168.105.127 check port 990 inter 10s rise 1 fall
2
backend eft_server2
server eft-server2 192.168.105.126
backend eft_server3
server eft-server3 192.168.105.127
frontend http
bind *:80
default_backend eft-http
frontend https
bind *:443
Page 6 of 8
default_backend eft-https
backend eft-http
mode http
balance roundrobin
stick on src table eft-https
appsession websessionid len 64 timeout 30m
server server1 192.168.105.125:80 weight 1 maxconn 512 check
cookie server1
server server2 192.168.105.126:80 weight 1 maxconn 512 check
cookie server2
server server3 192.168.105.127:80 weight 1 maxconn 512 check
cookie server3
backend eft-https
mode tcp
balance roundrobin
stick-table type ip size 200k expire 30m
stick on src
server server1 192.168.105.125:443 weight 1 maxconn 512 check
server server2 192.168.105.126:443 weight 1 maxconn 512 check
server server3 192.168.105.127:443 weight 1 maxconn 512 check
Page 7 of 8
Step 5. Start HAProxy service
Start the HAProxy service using following command.
You might also consider configure HAProxy to automatically start on system boot. Please consult your
OS documentation on how to start services automatically.
Note:
If you are using VM images for your HAProxy service and you are cloning images, please review this
article:
http://www.envision-systems.com.au/blog/2012/09/21/fix-eth0-network-interface-when-cloning-
redhat-centos-or-scientific-virtual-machines-using-oracle-virtualbox-or-vmware/
Note: It is NOT recommended that you disable your firewall in your production environment; you
should consult with your Network Administrator before make any changes.
References
http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
Page 8 of 8