

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Offline
incomplete
2: Break the Network
incomplete
3: Load Balancers
incomplete
4: Application Servers
incomplete
5: Custom Network
incomplete
6: Configuring the Load Balancer
incomplete
This lesson's interactive features are locked, please to keep using them
First, we need to start some application servers so that our load balancer has somewhere to send the traffic! We'll use Caddy, an awesome open-source load balancer and web server. Nginx and Apache are other popular alternatives that do similar things, but Caddy is a modern version written in Go, so it'll be fun to use.
Each application server will serve a slightly different HTML webpage. We'll make them different so that we can see load balancing in action!
docker pull caddy
<html>
<body>
<h1>Hello from server 1</h1>
</body>
</html>
<html>
<body>
<h1>Hello from server 2</h1>
</body>
</html>
docker run -d -p 8881:80 -v $PWD/index1.html:/usr/share/caddy/index.html caddy
docker run -d -p 8882:80 -v $PWD/index2.html:/usr/share/caddy/index.html caddy
Run and submit the CLI tests.