Assignment for Week 4: Web service and basic load-balancing
Description
In this assignment you'll use Puppet to install and configure
a web server and set up a basic high-availability load-balancing
configuration for it.
Load-balancing is a basic technique for creating more reliable
services and making it possible to easily increase service capacity
in response to increased demand.
What you need to do
- Develop a Puppet module that can install and configure a web
server on your instances. The most popular choice here
is Apache httpd (but some
alternatives exist, like nginx).
Make sure your Puppet module installs any packages needed for your
web server, ensures that it starts at boot time and stays running,
and manages its configuration files. You will need to demonstrate
that your web server can serve a page from its document root.
- Make sure you have a web server running on your two instances.
You should be able to do this merely by applying the web server
Puppet module to both of your instances.
- Follow the instructions in the tutorial
Getting Started with Elastic Load Balancing
to create a simple load balanced web server configuration. Give it
a name that contains your team name (at least whatever fits within
the name limits). You should be able to use the default
"lab-cloud-security-group" for your load balancer configuration in
step 2. You can skip step 3 ("configure security settings") and
step 6 ("tag your load balancer"). Don't set up any "Auto Scaling"
features in this assignment. You don't have to delete your load
balancer at the end (although it is a billable feature so we may
want to take them down not long after this assignment is done).
- Do some testing of your load balancer outside the basic checks
in the tutorial. Shut down the web server on one of your instances
("service apache2 stop" or the equivalent) and test whether access
through the load balancer still provides pages. Shut down both web
server instances and see how the load balancer responds (timeout?
"connection refused"?). Restore web service on one instance and
confirm the load balancer serves pages again. Restore web service
on both instances and confirm that requests are directed to each
instance by examing the web server logs.
- Also come up with some Puppet configuration for replicating web
server content across the instances that you use for your
load-balanced web server. This might involve using a Puppet file
resource to manage /var/www/html with the "recurse => true"
option, a job that pulls content from a subdirectory of a Git
repository, or rsync over ssh from a master copy of the content, as
examples of common methods.
What to turn in
Create a subdirectory in your team git repository with the name
"week4" and create files containing your handin materials under
that.
- Put up a web page on your system in its document root. Send me
the URLs to that page
(http://ip-x-x-x-x.aws.amazon.com/foo.html and I'll try to
retrieve it.
- In addition, find log messages showing accesses to a web page in
your web server document root, and send me samples of those log
messages.
- Provide the domain name associated with your load balancer so I
can test web server access to it.
- Describe the results of testing your load balancer when you shut
down one, then both, back-end instances, and when you restore them.
- Provide excerpts from web server logs from each of your web
server instances showing load balancer health checks and accesses to
your web content.
- Indicate the Puppet code you use to replicate content between
your web server instances.
Material for all of the above should be checked into your team
git repository by class time on Monday, July 22. For an individual
team member to receive credit for the assignment, they must have
made at least one commit.
Evaluation
For this assignment, most of my evaluation will be based on
whether you got your services working. Does your web server serve
up web pages? When sending me log data, please do not just
send me an entire log file -- show me individual examples of log
messages. I'll also review your Puppet modules for any apparent
errors or omissions.
Steve VanDevender
Last modified: Fri Jul 19 17:14:09 PDT 2013