Amazon AWS Basics Tutorial: Setting Up a Load-Balanced, Auto-Scaling Webserver

This step-by-step tutorial will show you how to build load-balanced, highly available, self-healing infrastructure on the Amazon Web Services (AWS) Cloud.

If you’ve been wondering how to get started with “DevOps,” “Cloud” System Administration, and public cloud providers in general, this is the series for you.

Amazon’s Cloud Services are vast — there are an enormous amount of things you can use:

  • services that replicate traditional Virtual Machines in a datacenter (EC2, RDS, Elasticache)
  • services that give you insane amounts of availability and durability, along with an innovative API (S3 for storage)
  • replacements for other solutions in brand new industries (ECS)
  • plenty of unique services that no one else is offering

 

If you really want to learn this stuff, you want to start with simple, practical examples that slowly walk you through the huge amount of new concepts that you’ll need to learn. You need something practical that you can use in real life, so that navigating Amazon’s immensely complex graphical user interface becomes second-nature.

Once you’ve got a grasp on the basic concepts and the most important services, we can dive into building more realistic, more complex infrastructure that uses specific AWS features to get the job done.

We’ll also explore the AWS API, which allows you to use a command-line client or bindings for your favorite programming language to work with infrastructure. This is the preferred way that professionals use to interact with AWS.

 

Video #1: Intro and EC2 Instance Creation

In the first video, you’ll learn the basics of working in the Amazon AWS Console (their graphical user interface) and set up an EC2 instance with a webserver on it. You’ll create your first security group (AWS network firewall rules), set up SSH keys, and connect to your ‘development’ instance for the first time.

Once you’re ready for launch, you’ll learn how to create a new Amazon Machine Image (AMI) from your EC2 instance, which we can use to spin up clones of that instance later on.

 

Video #2: Auto-Scaling Groups and Launch Configurations

In the second video, I’ll show you how to set up an Auto-Scaling Group (ASG) which uses a Launch Configuration to spin up new EC2 instances (clones of your development instance). We’ll talk a bit about scaling and how you’d set it up in a real project.

 

Video #3: Tying it together with an Elastic Load Balancer

In the third video, you’ll be setting up an Amazon Elastic Load Balancer (ELB) to balance traffic across the instances in your Auto-Scaling Group. I’ll show you how to add health checks and hook up the Application Load Balancer to your ASG, so it automatically balances across healthy instances in your ASG, even as they’re added and removed.

 

There’s more coming, so stay tuned!

New Books Added to the Sysadmin Reading List!

I’ve just added some more amazing books to the sysadmin reading list page. These are books that I’ve read over the last year which are so spectacular that I think every sysadmin (or aspiring sysadmin) needs to read and digest them.

Some standouts from the list above:

The Linux Command Line: A Complete Introduction

I watched a project manager with no hands-on technical experience go through this book. After about a week, he was comfortable moving around on the command line, (git) pulling down the latest version of the code that his team was working on, running shell scripts, and doing other basic Linux/Unix tasks. I think it’s fair to say that this book put him on track for becoming a savage beast (for a PM).

 

The Practice of Cloud System Administration: DevOps and SRE Practices for Web Services, Volume 2

This is one of the greatest system administration / infrastructure / DevOps / System Reliability Engineering (SRE) / Platform Engineering books I’ve ever read.

Do you remember how the UNIX and Linux System Administration Handbook, 4th Edition taught you how Unix and Linux work in a deep and practical way, and how it showed you what it takes to administrate a single server or a small group of servers?

That’s what this book does, except for modern large-scale infrastructure (hundreds/thousands of servers). It will show you how to design infrastructure properly. It will teach you how to think about reliability. It will show you how to take (most of) the pain out of monitoring and alerting.

I can’t say enough good things about it. Seriously, if you want to be a Google/Amazon/<insert-enormous-tech-company-here>-level Admin, this book will introduce you to the skills you need.

Buy it, now!

 

 

Okay, I’m ending this post here because I need to get to work — a place where I will undoubtedly use the skills you can learn from these books.

So read these books, and then get out there and start doing this stuff!

Advice to an Aspiring Sysadmin

I get a *lot* of e-mails and YouTube messages asking me how to become a system administrator. Usually I just point people at the blog or YouTube channel, but yesterday I decided to write up something a bit more complete. Here’s a slightly modified version for easy reading.

 

 

Asking Questions, doing Research, and getting Help

This is worth its virtual weight in gold: http://www.catb.org/esr/faqs/smart-questions.html

Subreddits are great. Check out /r/linux, /r/sysadmin, /r/networking, /r/programming, and others. Long story short, find communities that are doing things you’re interested in.

No one will sign up to mentor you, but if you show interest and effort, work on practical projects, and ask well-prepared questions, people will generally treat you well and help you out.

Read more

Cron Jobs

Cron jobs allow you to repeatedly run commands. They can be run both in a timed manner, but also on bootup. While cron may seem a bit confusing in the beginning, it’s actually very simple to use once you know how it works.

Read more

man man – What does the 1 in ls(1) mean?

man pages – many people would have loved to have known earlier about them. This article could be summed up as “just read man-pages(7)”. But what does that mean and why should you care?

Read more

Git: Setting up a low-requirements, personal Git repository

In this tutorial you will learn how to  how to quickly set up a simple, low-requirements, no-database, no-webserver Git repository. All you need is (unprivileged) SSH access and the git program itself.

Read more

The System Administration Course on Udemy is now $12 (from $45)!

It’s been several months since I released my project-based system administration course on Udemy (https://www.udemy.com/hands-on-linux-self-hosted-wordpress-for-linux-beginners/?couponCode=SYSADMINW12).

To celebrate a big move back to the U.S. (and a new job), I just lowered the price from $45 to $25. As always, the tutorialinux sysadmin horde gets a better deal: $12 for all 8 hours of the video course.

For those that don’t know about the course, it’s titled “Hands-on Linux: Self-Hosted WordPress for Linux Beginners” and will teach you the basics of Linux system administration using a real-life project. You’ll set up a WordPress website, and the infrastructure to run further websites (as many as you want).

More info can be found in my original post about the course.

I also show you the sysadmin skills that you generally don’t see in tutorials or YouTube videos: automation, security hardening, backups and restores, next steps and add-on project ideas.

There’s a 30-day money back guarantee on Udemy, so there’s no risk if you find that the course isn’t for you.

Have fun!

https://www.udemy.com/hands-on-linux-self-hosted-wordpress-for-linux-beginners/?couponCode=SYSADMINW12

Shell Aliases

When working on Linux and Unix systems, you’ll often find yourself using long shell commands that you repeat several times per day (or per session). Things like

  • checking on the current resource usage of a system,
  • checking if a process has completed yet, or
  • using a complex group of commands, piped together with special options to give you just the output you want.

Generally, you’ll either use CTRL+R to search for these past commands in the shell’s history. Some of you may even copy useful commands to a special file that you can easily reference. You might even just enter them manually each time you need them, since you’re too lazy to be bothered.

There’s a simple solution that covers all of these cases well: Aliases.

Read more

How to convert an SSH2 Public Key into an OpenSSH public key

When working with people who don’t use a Unix-based operating system, you’ll often come across the SSH2 Public Key format. PuTTY is probably the most famous software using this format and nearly everyone on Windows uses it. To give them access to a system, SFTP server, Git repository or similar you often need to convert an SSH2 public key into the OpenSSH format. This article describes how to do exactly that.

Read more

How to Install Dwarf Fortress on Ubuntu 16.04

Note: If you don’t know what Dwarf Fortress is, you owe it to yourself to learn a bit about it. It’s one of the most interesting and detailed games/simulations/sandboxes ever created.

I just spent a bit of time getting Dwarf Fortress installed on Ubuntu 16.04. I didn’t find much in the way of up-to-date instructions, so I’m writing down what works as of today (June 2016). If you’re wondering how to install Dwarf Fortress on Ubuntu 16.04, here’s what you’ll want to do:

Read more