Handling Traffic

AWS offers Route53 for DNS and related services. ELB optimally distributes load between your EC2 instances.

Route53

Route53 is a DNS Service that provides a reliable and scalable way to route traffic. DNS maps IP to a domain name. Key features:

  • global, highly available DNS
  • domain registration
  • public and private names
  • multiple routing algorithm
  • both IPv4 and IPv6
  • integrated with other AWS cloud Services

To setup:

Amazon Storage Options

Amazon offers a few storage options:

  • File Storage - use EFS
  • Block Storage - use EBS and EC2
  • Object Storage - use S3

EFS works very much like your computer's directory structure. All files are classified hierarchically and each has a unique address which is used to retrieve it. Block storage is mostly used by software. Object can be any raw data such as an image, text file, pdf, etc. Objects are non-relational and unstructured. Each object has a unique id. This id is used to retrieve the object. REST API can also be used to access objects.

Autoscaling

Autoscaling ensures that you have the sufficient AWS EC2 instances available to handle the load and it also ensures that you don't have more instances allocated than you require.

The load on a server fluctuates over time. Autoscaling allows you to allocate more EC2 resources when you need them and retire them when you no longer need them. You can either manually define peak and low-peak times or you can define rules based on CloudWatch alarm that automatically allocate and retire resources as needed.

How to access AWS Cloud

There are 3 ways to use AWS:

  • AWS Management Console (GUI Interface)
  • Command Line Interface (CLI)
  • Software Development Kits (SDKs) - enables access using other tools

To access the console, go to http://aws.amazon.com/console. Login and you will see a list of resources and services you can setup and configure.

CLI interface allows you to access AWS through your terminal window. See AWS CLI to learn how to use it. Example command:

aws ec2 describe-instances

What user is apache running as?

You often need to know the username of Apache to assign proper permissions to certain files it will be accessing. To find out:

ps aux | egrep '(apache|httpd)'

You will probably see multiple users. Ignore the root. Go with the other name. It is usually www-data in Ubuntu.

Connect to Linux Instance using SSH on AWS EC2

  1. Go to (http://aws.amazon.com)
  2. Sign in
  3. Click on EC2
  4. Click on Running Instances
  5. Select you pem key. It should match the key pair name.
  6. Make sure that the pem key has "chmod 400" permission
  7. Open terminal and type: ssh -i mykey.pem username@public_dns_name

username is: - ec2-user for Amazon Linux - ec2-user for RHEL5 - ubuntu for Ubuntu - ec2-user for Fedora - ec2-user for SUSE Linux

Pages