This project demonstrates an enterprise-level implementation of a High Availability Load Balancing architecture using HAProxy. The system distributes incoming user traffic across multiple backend web servers using the Round Robin algorithm while providing real-time monitoring through HAProxy Stats.
The project is deployed on VMware virtual machines and simulates a real-world enterprise environment.
- Implement Load Balancing using HAProxy.
- Distribute traffic using Round Robin algorithm.
- Host two independent web applications.
- Monitor server health in real time.
- Simulate enterprise architecture.
- Implement backend health checks and failover.
User Browser
|
|
Public IP (HAProxy)
|
VM1 Load Balancer
HAProxy + Stats
|
-------------------------
| |
| |
VM2 Cloud Service Node VM3 Cyber Service Node
Apache Web Server Apache Web Server
Responsibilities:
- Receives all user requests
- Uses Round Robin algorithm
- Performs health checks
- Hosts HAProxy Stats dashboard
- Exposes one public IP
Software:
- Ubuntu 22.04
- HAProxy
Responsibilities:
- Hosts custom website
- Acts as Backend Pool Server 1
Software:
- Ubuntu 22.04
- Apache2
- HTML
- CSS
Responsibilities:
- Hosts custom website
- Acts as Backend Pool Server 2
Software:
- Ubuntu 22.04
- Apache2
- HTML
- CSS
- VMware
- Ubuntu 22.04
- HAProxy
- Apache2
- HTML
- CSS
- Git
- GitHub
Incoming requests are distributed sequentially.
Example:
Request 1 → VM2
Request 2 → VM3
Request 3 → VM2
Request 4 → VM3
This ensures equal traffic distribution.
Dashboard URL:
http://LOAD-BALANCER-IP:8404/stats
Monitored parameters:
- Backend Server Status
- Active Sessions
- Request Count
- Health Checks
- Response Time
- Server Availability
Health checks continuously verify backend server availability.
Configuration:
default-server inter 3s fall 3 rise 2
Meaning:
- inter 3s = Check every 3 seconds
- fall 3 = Mark DOWN after 3 failures
- rise 2 = Mark UP after 2 successful checks
If VM2 goes offline:
systemctl stop apache2
HAProxy automatically redirects all traffic to VM3.
When VM2 comes back online:
systemctl start apache2
Traffic distribution resumes automatically.
apt update
apt install apache2 -yapt update
apt install haproxy -yhaproxy -c -f /etc/haproxy/haproxy.cfgsystemctl restart haproxysystemctl status haproxysystemctl start apache2systemctl stop apache2- Enterprise Architecture
- HAProxy Load Balancing
- Round Robin Algorithm
- Real-Time Monitoring
- Backend Health Checks
- Automatic Failover
- Attractive Web Interfaces
- VMware Deployment
- GitHub Integration
- SSL/HTTPS
- Reverse Proxy
- Logging Server
- Prometheus Monitoring
- Grafana Dashboards
- DNS Integration
- Chand Parveen
- Shivani Sharma