HAProxy Load Balancing

Learn HAProxy Load Balancing. This module covers HAProxy Installation, HTTP Load Balancing, Dashboard and Statistics, TCP Layer Balancing, ACLs and Smart Routing. You will master these essential Linux skills through hands-on labs and real-world challenges.

DevOps EngineerAnsibleDevOpsLinux

Introduction

HAProxy can distribute connections, remove unhealthy backends from rotation, and route requests according to application-level conditions. This hands-on course lets you build and test those behaviors with small local services whose responses make each routing decision visible.

You will configure HTTP round-robin balancing, expose the statistics page, proxy TCP connections, and select a backend with a path-based ACL. The final challenge adds active checks to a three-node simulated web cluster, then verifies failover and automatic recovery by stopping and restarting one backend.

What You Will Learn

  • Install HAProxy, locate its configuration, create a backup, and verify the service
  • Define HTTP frontends and backends and validate round-robin distribution
  • Add active backend checks and observe node removal and recovery
  • Enable and reach HAProxy’s built-in statistics page on port 8404
  • Configure TCP-mode balancing and test it with simple connection listeners
  • Define a path-prefix ACL and route matching requests to a separate backend
  • Validate configuration, restart or reload HAProxy, and test behavior with curl and nc

Who This Course Is For

This intermediate course is for Linux administrators, DevOps practitioners, and backend learners who want a practical introduction to HAProxy configuration, traffic distribution, and basic failover.

Prerequisites: Comfort with Linux shell commands, sudo, services, configuration files, IP addresses, TCP ports, and basic HTTP request concepts.

Learning environment: A single Linux lab machine with HAProxy, local Python HTTP servers, Netcat listeners, and administrator access. All backend “nodes” are separate localhost ports, allowing routing behavior to be tested without external servers.

Frequently Asked Questions

Will I work with a real multi-server cluster?

No. The backends are lightweight services on different ports of one lab machine. You still exercise real HAProxy balancing, health checks, failover, recovery, and ACL routing against those processes.

Does the TCP lab configure a real MySQL cluster?

No. It uses Netcat listeners on ports 3307 and 3308 to make TCP round-robin responses visible. It does not install MySQL, configure replication, or test database sessions.

Does the course cover production security and advanced HAProxy operations?

No. TLS termination, stats authentication, secrets, stick tables, session persistence, rate limiting, logging pipelines, and HAProxy high availability are outside the scope. The statistics listener is intentionally simple and unauthenticated in the isolated lab.

Teacher

labby
Labby
Labby is the LabEx teacher.