Amazon Web Services

Post on 17-Nov-2014

1.268 views 1 download

Tags:

description

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

Transcript of Amazon Web Services

Amazon Web ServicesDuy Lam – April 2012duylam@kms-technology.comSkype: duypl.skype

2

What you can do after this

Public

Relational Database Service

AutoScaling CloudWatch

Simple Queue Service

Load Balancing

Notification

EC2

use

Application

3

Agenda

Public

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

4

Application as Service

Platform as Service

Infrastructure as Service

Public

Cloud Computing

5

Regions

Public

us-east-1

us-west-1

eu-west-1

ap-southeast-1

ap-northeast-1

us-west-2

sa-east-1

6

Availability Zones

Public

Regions

7

Usage of Regions and Availability Zones

Public

closer to specific customers, meet legal etc.

Regions

8

Data Transfer Cost

Public

EU (Ireland)

EC2 machine

1

EC2 machine

2

Availability Zone

US-West (Northern California)

$!

$$

$!

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)(**)

10

Agenda

Public

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

11

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

12

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

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

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

15

Public AMI

Public

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

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

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

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

20

Demo

Public

21

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

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

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

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>

25

EBS Pricing Model

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

Other impact factors: Region

Public

26

Amazon EC2 Web Service

Basic Storage Customized AMIs

Public

27

Needs of customized AMI

To meet the your own needsTo shareTo sell

Public

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

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

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

31

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

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

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

34

Enable detailed monitoring

Public

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

PROMPT> ec2-monitor-instances instance-id

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

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

37

Demo

Public

38

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

39

Amazon Elastic Load Balancing Web Service

Public

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

41

Pricing Model

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

instance

Other impact factors: Region

Public

42

Demo

Public

43

Amazon Compute Services

EC2 CloudWatch

Elastic Load Balancing

Auto Scaling

Public

Public 44

Amazon AutoScaling Web Service

Auto Scaling

Scale Up

Monitor

Scale Down

trigger

trigger

Public 45

Type of Scaling

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

CloudWatch alarm

Public 46

Pricing Model

* Regular Amazon EC2 and Amazon CloudWatch service fees applied

Public 47

Demo

Public 48

Agenda

Amazon Cloud Platform

Amazon Compute Services

Amazon Services

Public 49

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

Public 50

Amazon Relational Database Web Service

Resizable capacity for databases

Amazon firewallFlexible back up

methodsReplication (only on

MySQL)Monitoring

Public 51

Create new DB Instance

Update DB Security Group before connecting to the instance

Public 52

MySQL Replication

Multi-AZ deployment

To increase database availability

Read Replicas

For read-heavy database workloads

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

Public 54

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

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

Public 56

Key Features

Control access to buckets and objects

Versioning objects in a bucket

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

Public 58

Demo

Public 59

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

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

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

Public 62

Pricing Model

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

Other impact factors: Region

Public 63

Demo

Public 64

Amazon Services

Relational Database Service

Simple Storage Service

Simple Queue Service

Simple Notification

Service

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

receiver@email.com

Queue

http://receiver.com/message

Message (text)

SMS (in US)

Subscriber

800-201-7575

Public 66

Key Features

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

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

Public 68

Demo

CLOSING

Public 70

More for you

THANK YOU