Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Creating a Load Balancer

In this learning activity, you will install and configure a load balancer to be the front end for two pre-built Apache nodes. The load balancer should be configured to run in the best-effort stickiness mode.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 14, 2025
Duration
1h 30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install HAProxy on `Server1`

    Now, we'll start off by installing HAProxy:

    [root@Server1]# yum -y install haproxy
    

    Enable and start the service:

    [root@Server1]# systemctl enable haproxy
    [root@Server1]# systemctl start haproxy
    

    Then verify that incoming port 80 traffic is permitted through the firewall. Running firewall-cmd --list-all should show http in the list of allowed services.

  2. Challenge

    Configure HAProxy on `Server1`

    We need to configure the HAProxy's frontend and backend. HAProxy should listen on port 80, and use node1 and node2 as the backend nodes. Let's edit /etc/haproxy/haproxy.cfg and add the configuration code:

    
        timeout check            10s
        maxconn                  3000
    
    # Our code starts here:
        
    frontend app1
            bind *:80		
            mode http
            default_backend apache_nodes
        
    backend apache_nodes
            mode http
            balance source		
            server node1 10.0.1.20:8080 check
            server node2 10.0.1.30:8080 check
    
    # End of our code
    #-------------------------------------------------------
    # main frontend which proxys to the backends
    #-------------------------------------------------------
    

    We'll have to restart the daemon so that our changes take effect, then check with ss:

    [root@Server1]# systemctl restart haproxy
    [root@Server1]# ss -lntp
    
  3. Challenge

    Configure the `node1` and `node2` Firewalls

    We need to permit incoming port 8080/TCP traffic on node1 and node2. On each node (after logging in, then becoming root), perform the following:

    [root@node]# firewall-cmd --permanent --add-port=8080/tcp
    

    Then reload the firewall configuration:

    [root@node]# firewall-cmd --reload
    
  4. Challenge

    From `Client1`, Validate That Settings Are Correct

    On Client1, we can run a curl on the Server1 private IP address:

    [cloud_user@Client1]$ curl &ltServer1_IP_ADDRESS>
    
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight