440 likes | 835 Views
Amazon EC2. By: Jonathan Brown. What is EC2?. Elastic Compute Cloud Provides resizable computing resources in the cloud ( IaaS ) Designed primarily with scaling in mind. Elastic. Increase or decrease capacity in minutes One or even thousands of instances can be created simultaneously
E N D
Amazon EC2 By: Jonathan Brown
What is EC2? • Elastic Compute Cloud • Provides resizable computing resources in the cloud (IaaS) • Designed primarily with scaling in mind
Elastic • Increase or decrease capacity in minutes • One or even thousands of instances can be created simultaneously • Controlled by APIs, so applications can automatically scale themselves
Flexible • Number of instances • Instance types • Operating systems • Software packages • Memory • CPU • Boot partition size
Complete Control • Root access to each of your instances • Can stop an instance but still retain its data on the boot partition • Remote rebooting • Console output
Cost-Effective • On-demand instances let you pay for computing capacity by the hour • Removes the need to buy “safety net” capacity for periodic spikes • Reserved instances • One time payment for each instance you want to reserve • Significant discount on hourly charge for that instance • Spot instances • Customers can bid on unused EC2 capacity and run instances for as long as their bid is greater than the current Spot Price • Spot price changes based on supply/demand
Secure • Works in conjunction with Amazon VPC (Virtual Private Cloud) • Instances are located in VPC with IP range you specify • You decide which instances are private or exposed • Security groups control in/out bound network access • Access to your VPC using Ipsec VPN • Option to use dedicated instances that use hardware available to a single customer
Reliable • Amazon promises 99.95% a vailabilityfor each of their EC2 regions • Equates to being down only 4 hours per year • Commitment made in their EC2 Service Level Agreement • (How binding is this if availability is lower?)
Interconnected • Designed for use with other AWS services • S3 (Simple Storage Service) • RDS (Relational Database Service) • SQS (Simple Queue Service) • SimpleDB • Provides a complete solution for computing, processing, and storage
Free Tier • Instance Uptime • 750 hours / month running a micro instance • Elastic Block Storage (EBS = Persistent) • 30 GB, 2 Million I/O, 1 GB Snapshot • Elastic Load Balancer • 750 hours / month, 15 GB data processing • Data transfer • 15 GB out / month across all AWS services
Web Interface • EC2’s web interface allows you to: • Launch instances with a variety of operating systems • Load your custom app environment • Manage network access permissions • Run you image on as many or few instances as necessary
Do It Yourself • Sign up for a free Amazon account • All AWS services come with a free tier for 1 year (EC2 free tier discussed later)
Do It Yourself (2) • Log in to your AWS account to go to your Management Console. Select EC2 to go to the EC2 Console.
Do It Yourself (3) • Select “Launch Instance” to begin setting up a new instance
Do It Yourself (4) • Select your image and 32/64 bit
Do It Yourself (5) • Choose your instance type • t1.micro is covered by the free tier
Do It Yourself (6) • Configure your instance details
Do It Yourself (7) • Add more storage if you need • 8 GB provided with free tier
Do It Yourself (8) • Tag your instance with an identifier
Do It Yourself (9) • Configure your security group (firewall) • Security groups can be assigned individually or include multiple AWS services
Do It Yourself (10) • Review your instance settings
Do It Yourself (11) • Set up a key pair for your instance • Key pair allows access to instance (SSH, SFTP)
Do It Yourself (12) • View your EC2 Management Console
Do It Yourself (13) • Log in to your instance • SSH • ssh -ikey.pem ec2-user@ec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com • FTP (I used Filezilla) • Add key.pem to the SFTP settings • Login as ec2-user (no password) • Once your instance is running you have root access and can access it like any other server • Note: also able to set up free elastic IP to attach to any of your instances which makes log in simpler
My Thoughts on EC2 • The entire process took less than 10 minutes from logging into my Amazon account to SSH into my new instance • This was with no prior knowledge of EC2 • Default options are selected, so it’s okay if you don’t know what to choose • The only tricky part was configuring the firewall properly for my IP, but that only took a few minutes
My Thoughts on EC2 • The free tier is useful for exploring EC2, but not much use beyond a very low traffic website • T1.micro instance • 0.615 GB RAM • Network performance = “very low”
Elastic Beanstalk • EC2 was great for having control over the infrastructure, but for my project I don’t need this • Elastic Beanstalk is Amazon’s PaaS • Simply upload your bundle and it deploys to EC2 instances • Load balancer adds and removes instances based on defined settings • Provides monitoring and metrics of your application’s environment • NOTE: You still have full access to the EC2 instances that run your application
RDS and S3 • I also explored RDS (Relational Database Service) and S3 (Simple Storage Service) to round off the services my application needed • RDS • Scalable database separate from any instance • 20 GB under free tier • S3 • Bucket-based storage • 5GB, 20000 GET, 2000 PUT under free tier