HAProxy
HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications, used for Load Balancer . Provides a high availability load balancer and proxy server for TCP and HTTP-based applications.
Prepare
When referring to this document to use HAProxy, please read and ensure the following points:
-
Login to Websoft9 Console and find or install HAProxy:
- Go to My Apps listing applications
- Go to App Store installing target application
-
This application is installed by Websoft9 console.
-
The purpose of this application complies with the GPL-2.0 open source license agreement.
-
Configure the domain name or server security group opens external network ports for application access.
Getting started
Login verification
-
After Completing the installation of HAProxy in the Websoft9 console, get the applicaiton's overview and access credentials from My Apps.
-
Set the password in the configuration file.
Enable HAProxy Monitoring
HAProxy Statistics Report is set by default and can be viewed through Websoft9 console > access > backend.
High Availability
Achieve High Availability of HAProxy by deploying Keepalived.
Cluster Configuration
To enable HAProxy clustering, add cluster server info to the configuration file.
Examples are as follows:
## HTTP Site Configuration]
listen http_web 192.168.10.10:80
mode http
balance roundrobin # Load Balancing algorithm
option httpchk
option forwardfor
server server1 192.168.10.100:80 weight 1 maxconn 512 check
server server2 192.168.10.101:80 weight 1 maxconn 512 check
# [HTTPS Site Configuration]
listen https_web 192.168.10.10:443
mode tcp
balance source# Load Balancing algorithm
reqadd X-Forwarded-Proto: http
server server1 192.168.10.100:443 weight 1 maxconn 512 check
server server2 192.168.10.101:443 weight 1 maxconn 512 check
Configuration options
- Configuration file (mounted): /usr/local/etc/haproxy/haproxy.cfg
- CLI:
haproxy
- HAProxy APIS