amazon web services

72
Amazon Web Services Duy Lam – April 2012 [email protected] Skype: duypl.skype

Upload: duy-lam

Post on 17-Nov-2014

1.269 views

Category:

Technology


1 download

DESCRIPTION

Presents knowledge targeting on developers who want to build their system on Amazon cloud platform

TRANSCRIPT

Page 1: Amazon Web Services

Amazon Web ServicesDuy Lam – April [email protected]: duypl.skype

Page 2: Amazon Web Services

2

What you can do after this

Public

Relational Database Service

AutoScaling CloudWatch

Simple Queue Service

Load Balancing

Notification

EC2

use

Application

Page 3: Amazon Web Services

3

Agenda

Public

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

Page 4: Amazon Web Services

4

Application as Service

Platform as Service

Infrastructure as Service

Public

Cloud Computing

Page 5: Amazon Web Services

5

Regions

Public

us-east-1

us-west-1

eu-west-1

ap-southeast-1

ap-northeast-1

us-west-2

sa-east-1

Page 6: Amazon Web Services

6

Availability Zones

Public

Regions

Page 7: Amazon Web Services

7

Usage of Regions and Availability Zones

Public

closer to specific customers, meet legal etc.

Regions

Page 8: Amazon Web Services

8

Data Transfer Cost

Public

EU (Ireland)

EC2 machine

1

EC2 machine

2

Availability Zone

US-West (Northern California)

$!

$$

$!

Page 9: Amazon Web Services

9

Access Interfaces

Public

AWS SDKs (**)(*) : not all AWS services(**) : all AWS services

AWS Management

Console(*)

Java-based command

line(*)

AWS SDK(**)

Web Service (REST or

SOAP API)(**)

Page 10: Amazon Web Services

10

Agenda

Public

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

Page 11: Amazon Web Services

11

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

Page 12: Amazon Web Services

12

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

Page 13: Amazon Web Services

13

What is EC2 ?

“Amazon Elastic Compute Cloud (Amazon EC2) is a web service

that provides resizable computing capacity that you use to build and host your software systems”

Public

an EC2 instance

Availability Zone

Availability Zone

Page 14: Amazon Web Services

14

Amazon Machine Image & Instances

Public

AMI (Template)

- OS: Ubuntu- Platform: x86- Storage devices: null

EC2 Instance (Large Instance Type)

EC2 Instance (High-CPU Medium

Instance Type)

- 7.5 GB memory- 4 EC2 Compute Units (*)

- 850 GB instance storage

- 1.7 GB of memory- 5 EC2 Compute Units (*)

- 350 GB of instance storage

A sample AMI

Large Instance Type

High-CPU MediumInstance Type

(*) 1 EC2 Compute Unit = 1.0 - 1.2 GHz 2007 Opteron or 2007 Xeon processor

launch instance

launch instance

Page 15: Amazon Web Services

15

Public AMI

Public

Page 16: Amazon Web Services

16

Elastic Block Store & Instance Store

Public

Attach

Attach

instance store(ephemeral store)

EBS volume

Create snapshot

Instance

Instance A

EBS snapshot in Amazon S3

Create volume

Instance BNew EBS volume

Instance A Instance B

AttachDetach

Backup

Detaching

Persistence

Instance

EBS volume

Page 17: Amazon Web Services

17

Root device storage

Public

AMI backed by instance store

AMI backed by EBS

Instance A

Instance B

Attach more

Attach more

Root device storage

launch instance

launch instance

Page 18: Amazon Web Services

18

Elastic IP Addresses

Public

10.0.0.170

ec2-122-248-202-170...com

Internet user

10.0.0.190

10.0.0.180

ec2-122-248-202-180...com

1.1.1.1 1.1.1.2

Page 19: Amazon Web Services

19

Pricing Model

Usage hour per EC2 instanceData Transfer per EC2 instance (both “in”

and “out”) in different Availability Zone or Region

Data Transfer per Elastic IP Address (both “in” and “out”)

Other impact factors: Region, OS, Instance Type, Long-term Contract, Bidding

Public

Page 20: Amazon Web Services

20

Demo

Public

Page 21: Amazon Web Services

21

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

Page 22: Amazon Web Services

22

Storage Types

Elastic Block Store volume Instance store

Persistent V

Cross-instance access

V

Back up V

Size limits Up to 1TiB per volume Up to 3.3TiB per instance

Free V

Public

Page 23: Amazon Web Services

23

EBS Incremental Backup

Public

Time

0 GB 10 GB 15 GBEC2 instance

10 GB 5 GB

create snapshot create snapshot

15 GB

create EBS volume

Page 24: Amazon Web Services

24

Block device mapping

Public

OS: Amazon LinuxKernel: aki-13d5aa41 ….

Block device mapping/dev/sdb=none

AMI template

/dev/sdc=ephemeral0

/dev/sdd=snap-a08912c9:15:true

count up based on the instance type

<device name>=<value>

Page 25: Amazon Web Services

25

EBS Pricing Model

Storage volume (in GB) per monthI/O request (in million)

Other impact factors: Region

Public

Page 26: Amazon Web Services

26

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

Page 27: Amazon Web Services

27

Needs of customized AMI

To meet the your own needsTo shareTo sell

Public

Page 28: Amazon Web Services

28

AMI Creation Process

Windows Linux/UNIX

Root storage device

EBS-backed AMI

Instance store- backed AMI

From existing AMI

Fresh installation

Public

2

1

Page 29: Amazon Web Services

29

Launch the instance

Customize instance

Create image from customized

instance

Create snapshot of root device

Register image from snapshot

(1) Creating EBS-Backed AMIs

Public

PROMPT> ec2-create-image instance-id

PROMPT> ec2-register --root-device-name /dev/sda1 -b /dev/sda1=snap-12345678

OR

Page 30: Amazon Web Services

30

(2) Creating Windows instance store-backed AMI

Launch the instance

Customize instance

Bundle customized instance

to S3

Register bundled image

Public

PROMPT> ec2-bundle-instance instance-id PROMPT> ec2-register <s3-bucket>/image.manifest.xml -n image_name

OR OR

Page 31: Amazon Web Services

31

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

Page 32: Amazon Web Services

32

Amazon CloudWatch Web Service

Public

• CPU utilization• Network traffic• I/O• Latency

000

EC2 instances

EBS volumes

CloudWatch service

CloudWatch metrics

RDS instances

Load Balancers

Page 33: Amazon Web Services

33

CloudWatch modes

Public

• At 5-minutes frequency• Free of charge Basic

• For EC2 instances• At 1-minute frequency• $3.5+ per instance per month

Detailed

Page 34: Amazon Web Services

34

Enable detailed monitoring

Public

PROMPT> ec2-run-instances ami-id --monitor

PROMPT> ec2-monitor-instances instance-id

Page 35: Amazon Web Services

Public 35

CloudWatch Alarms

“Watches a single metric over a time period and invokes actions when the value of the metric exceeds a given

threshold over a number of time periods”

Amazon SNS topic

Auto Scaling policy OK state

ALARM state

INSUFFICIENT_DATA state

Page 36: Amazon Web Services

36

Pricing Model

Per EC2 instance / monthPer custom metric / monthPer Alarm / monthAPI Requests (per 1,000 Get, List, or Put

requests)

Other impact factors: Region

Public

Page 37: Amazon Web Services

37

Demo

Public

Page 38: Amazon Web Services

38

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

Page 39: Amazon Web Services

39

Amazon Elastic Load Balancing Web Service

Public

Page 40: Amazon Web Services

40

Overview for Developer

Sticky Sessions"X-Forwarded-Port", "X-Forwarded-For"

and "X-Forwarded-Proto" SupportKnown issue: HTTP 60 seconds timeout

for request

Public

Page 41: Amazon Web Services

41

Pricing Model

Usage hour per Load Balancer instanceData processed (in GB) per Load Balancer

instance

Other impact factors: Region

Public

Page 42: Amazon Web Services

42

Demo

Public

Page 43: Amazon Web Services

43

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

Page 44: Amazon Web Services

Public 44

Amazon AutoScaling Web Service

Auto Scaling

Scale Up

Monitor

Scale Down

trigger

trigger

Page 45: Amazon Web Services

Public 45

Type of Scaling

Manual scalingScaling by Schedule: in a future timeScaling by Policy : triggered by a

CloudWatch alarm

Page 46: Amazon Web Services

Public 46

Pricing Model

* Regular Amazon EC2 and Amazon CloudWatch service fees applied

Page 47: Amazon Web Services

Public 47

Demo

Page 48: Amazon Web Services

Public 48

Agenda

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

Page 49: Amazon Web Services

Public 49

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

Page 50: Amazon Web Services

Public 50

Amazon Relational Database Web Service

Resizable capacity for databases

Amazon firewallFlexible back up

methodsReplication (only on

MySQL)Monitoring

Page 51: Amazon Web Services

Public 51

Create new DB Instance

Update DB Security Group before connecting to the instance

Page 52: Amazon Web Services

Public 52

MySQL Replication

Multi-AZ deployment

To increase database availability

Read Replicas

For read-heavy database workloads

Page 53: Amazon Web Services

Public 53

Pricing Model

Per DB Instance Class / monthStorage (in GB) / monthI/O (in million) / monthBack up storage / monthBandwidth (in GB both “in” / ”out”) / month

Other impact factors: Region, Multi-AZ Deployment, Reserved Instances

Page 54: Amazon Web Services

Public 54

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

Page 55: Amazon Web Services

Public 55

Amazon Simple Storage Web Service

Amazon S3 is storage for the Internet

User A S3 bucket

User B

HTTP PUT request

HTTP GET response

Page 56: Amazon Web Services

Public 56

Key Features

Control access to buckets and objects

Versioning objects in a bucket

Page 57: Amazon Web Services

Public 57

Pricing Model

Storage (in GB) / monthRequests (in 1000 unit) / monthBandwidth (in GB both “in” / ”out”) / month

Other impact factors: Region, Reduced Redundancy Storage option

Page 58: Amazon Web Services

Public 58

Demo

Page 59: Amazon Web Services

Public 59

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

Page 60: Amazon Web Services

Public 60

Your application

Amazon Simple QueueWeb Service

Machine A

message (text)

HTTP GET or POST request

Machine B

message (text)

HTTP GET or POST response

Message 1

Message 2

Message 3

Message 4

Amazon Queue

Page 61: Amazon Web Services

Public 61

Key Features

64 KB of text in a messageNot first in, first out delivery of messagesLocking the message: Visibility Timeout

Control access to a queue

Page 62: Amazon Web Services

Public 62

Pricing Model

$0.01 per 10k requests"out" bandwidth (in GB)

Other impact factors: Region

Page 63: Amazon Web Services

Public 63

Demo

Page 64: Amazon Web Services

Public 64

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

Page 65: Amazon Web Services

Public 65

Subscriber

Subscriber

Subscriber

Notification topic

Amazon Simple Notification Web Service

SNS

message (text)

HTTP GET request

Program A

message (text)

message (text)

message (text)

HTTP POST request

Email

Simple Queue Service

[email protected]

Queue

http://receiver.com/message

Message (text)

SMS (in US)

Subscriber

800-201-7575

Page 66: Amazon Web Services

Public 66

Key Features

Message: UTF-8 encoded up to 8 KBControl access to a topic

Page 67: Amazon Web Services

Public 67

Pricing Model

$0.06 per 100k API Requests (free first 100k requests) / month

Amount of notifications (free first part) / month

"out" bandwidth (in GB)

Other impact factors: Region

Page 68: Amazon Web Services

Public 68

Demo

Page 69: Amazon Web Services

CLOSING

Page 70: Amazon Web Services

Public 70

More for you

Page 72: Amazon Web Services

THANK YOU