25
Облачные амазонки и др. X1 Dev Девелоперы 1шт. Serge.Kovaleff gmail.com linkedin.com facebook.com @

X1 Dev Club - Amazon EC2 et al

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: X1 Dev Club - Amazon EC2 et al

Облачные амазонки и др.

X1 DevДевелоперы 1шт.

Serge.Kovaleffgmail.comlinkedin.comfacebook.com

@

Page 2: X1 Dev Club - Amazon EC2 et al

Цели● Ознакомиться с облаками и пр.

белокрылыми ромашками

● Понять облачный тренд

● Поместить облака и конкретно Амазон в

свою картину мира

● Возможно, узнать пикантные подробности

Page 3: X1 Dev Club - Amazon EC2 et al

План● Откуда есть и пошел Амазон как

СааС● SaaS, IaaS, PaaS, ...aaS?● Что нам Зе Вендор сулит● Куски Питона● Куски Баша (не Орг)● Подводные камни

Page 4: X1 Dev Club - Amazon EC2 et al

Что такое SaaS?

Page 5: X1 Dev Club - Amazon EC2 et al

Grids ...

Virtualization!

Clouds ...

Page 6: X1 Dev Club - Amazon EC2 et al

... aaS

Page 7: X1 Dev Club - Amazon EC2 et al

Jeffrey P. BezosFounder and Chief Executive OfficerAmazon.com, Inc.

"then-new U.S. Supreme Court ruling [that] online retailers don't have to collect sales taxes in states where they lack a physical presence"

"You can do the math 15 different ways, and every time the math tells you that you shouldn’t lower prices because you’re going to make less money. That’s undoubtedly true in the current quarter, in the current year. But it’s probably not true over a 10-year period, when the benefit is going to increase the frequency with which your customers shop with you, the fraction of their purchases they do with you as opposed to other places. Their overall satisfaction is going to go up."

Bezos indicated that he founded the space company to help enable "anybody to go into space"

Письмо CEO

Page 8: X1 Dev Club - Amazon EC2 et al
Page 9: X1 Dev Club - Amazon EC2 et al

● Amazon AWS Authentication, an implicit service, the authentication infrastructure used to authenticate access to the various services.● Amazon CloudFront, a content delivery network (CDN) for distributing objects to so-called "edge locations" near the requester.● Amazon CloudSearch provides basic full text search and indexing of textual content.● Amazon CloudWatch, provides monitoring for AWS cloud resources and applications, starting with EC2.● Amazon DevPay, currently in limited beta version, is a billing and account management system for applications that developers have built atop Amazon Web

Services.● Amazon DynamoDB (DynamoDB} provides a scalable, low-latency NoSQL online Database Service.● Amazon Elastic Beanstalk provides quick deployment and management of applications in the cloud.● Amazon Elastic Block Store (EBS) provides persistent block-level storage volumes for EC2.● Amazon Elastic Compute Cloud (EC2) provides scalable virtual private servers using Xen.● Amazon Elastic MapReduce allows businesses, researchers, data analysts, and developers to easily and cheaply process vast amounts of data. It uses a hosted

Hadoop framework running on the web-scale infrastructure of EC2 and Amazon S3.● Amazon ElastiCache provides in-memory caching for web applications.● Amazon Flexible Payments Service (FPS) provides an interface for micropayments.● Amazon Fulfillment Web Service provides a programmatic web service for sellers to ship items to and from Amazon using Fulfillment by Amazon.● Amazon Glacier, Provides a very low cost storage option based on its S3 storage solution. High redundancy and availability, but high access times. Ideal for archiving

data.● Amazon Historical Pricing provides access to Amazon's historical sales data from its affiliates. (It appears that this service has been discontinued.)● Amazon Mechanical Turk (Mturk) manages small units of work distributed among many humans.● Amazon Product Advertising API formerly known as Amazon Associates Web Service (A2S) and Amazon E-Commerce Service (ECS), provides access to Amazon's

product data and electronic commerce functionality.● Amazon Relational Database Service (RDS) provides a scalable database server with MySQL and Oracle support.● Amazon Route 53 provides a highly available and scalable Domain Name System (DNS) web service.● Amazon Simple Email Service (SES) provides bulk and transactional email sending.● Amazon Simple Storage Service (S3) provides Web Service based storage.● Amazon Simple Queue Service (SQS) provides a hosted message queue for web applications.● Amazon Simple Notification Service (SNS) provides a hosted multiprotocol "push" messaging for web applications.● Amazon Simple Workflow (SWF) is a workflow service for building scalable, resilient applications.● Amazon SimpleDB, allows developers to run queries on structured data. It operates in concert with EC2 and S3 to provide "the core functionality of a database."● Amazon Virtual Private Cloud (VPC) creates a logically isolated set of Amazon EC2 instances which can be connected to an existing network using a VPN

connection.● AWS CloudFormation, create a collection of related AWS resources and provision them in an orderly and predictable fashion.● AWS Import/Export, accelerates moving large amounts of data into and out of AWS using portable storage devices for transport.● AWS Management Console (AWS Console), A web-based point and click interface to manage and monitor the Amazon infrastructure suite including EC2, EBS,

Amazon Elastic MapReduce, and Amazon CloudFront.● AWS Storage Gateway, an iSCSI block storage appliance with cloud-based backup.

Page 10: X1 Dev Club - Amazon EC2 et al
Page 11: X1 Dev Club - Amazon EC2 et al
Page 12: X1 Dev Club - Amazon EC2 et al

Top 5 3 Амазонских Сервиса

● Elastic Compute Cloud (EC2)

● Elastic Block Store (EBS)

● Simple Storage Service (S3)

● Simple Email Service (SES)

● DynamoDB

Page 14: X1 Dev Club - Amazon EC2 et al

Elastic Compute Cloud● hiring a server running at a remote location

● virtualized server instances as Amazon Machine Images (AMI)● details on the instance types http://aws.amazon.com/ec2/instance-types/ http:

//aws.amazon.com/ec2/#instance

● pre-configured AMIs

● attach to an IP called the Elastic IP● dynamic capability of launching multiple instances of the same AMIs to scale up

and terminating them to scale down

● One EC2 Compute Unit provides the equivalent CPU capacity of a 1.0-1.2 GHz

2007 Opteron or 2007 Xeon processor

● Service Level Agreement commitment is 99.95% availability

● Regions: US East (Northern Virginia), US West (Oregon), US West (Northern

California), EU (Ireland), Asia Pacific (Singapore), Asia Pacific (Tokyo), South

America (Sao Paulo), and AWS GovCloud.

Page 15: X1 Dev Club - Amazon EC2 et al

EC2 алгоритм

● choose a pre-configured AMI

● launch that AMI

● customize it by adding additional software

and/or by loading an app

● save that AMI as your custom AMI on S3

● launch multiple instances

● ... profit )

Page 16: X1 Dev Club - Amazon EC2 et al

Подробнее о Типах● First generation (M1) Standard● Second generation (M3) Standard● Micro instances (t1.micro)● High-Memory Instances● High-CPU Instances● Cluster Compute Instances● Cluster GPU Instances● High I/O Instances

● EBS-Optimized Instances● Reserved Instances● Spot Instances● Dedicated Instances

Page 17: X1 Dev Club - Amazon EC2 et al

Elastic Block Store

Page 18: X1 Dev Club - Amazon EC2 et al

Elastic Block Store● volumes are network-attached

● persist independently from the life of an instance

● highly available, highly reliable● as instance’s boot partition

● attached to a running Amazon EC2 instance as a standard block device

● improved durability over local Amazon EC2 instance stores

● automatically replicated on the backend (in a single Availability Zone)

● ability to create point-in-time consistent snapshots of your volumes that are then

stored in Amazon S3, and automatically replicated across multiple Availability

Zones

● Standard volumes and Provisioned IOPS volumes

Page 19: X1 Dev Club - Amazon EC2 et al

Simple Storage Service

Page 20: X1 Dev Club - Amazon EC2 et al

Simple Storage Service● can be accessed by any application with access to the internet

● can store any arbitrary data as objects accompanied by metadata

● organized into buckets

● permissions defined in the Access Control List (ACL)

● object can be 5GB in size while the metadata can be up to 2KB

● can be accessed using simple REST or SOAP calls

Page 21: X1 Dev Club - Amazon EC2 et al

Mighty Python

1. % git clone https://github.com/boto/boto

2. % cd boto

3. % sudo python setup.py install

4. >>> import boto

5. >>> ec2 = boto.connect_ec2

(aws_access_key_id='my_access_key',

6. aws_secret_access_key='my_secret_key')

Page 22: X1 Dev Club - Amazon EC2 et al

Quick test

1. >>> import boto

2. >>> ec2 = boto.connect_ec2()

3. >>> ec2.get_all_zones()

4. [Zone:us-east-1a, Zone:us-east-1b, Zone:us-east-1c, Zone:

us-east-1d]

Page 23: X1 Dev Club - Amazon EC2 et al

Universal bash

1. #!/bin/bash

2. export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

3. export EC2_HOME=/Users/arjan/src/ec2-api-tools-1.3-46266

4. export AWS_RDS_HOME=/Users/arjan/src/RDSCli-1.1.005

5. export PATH="$EC2_HOME/bin:$AWS_RDS_HOME/bin:$PATH"

6. export EC2_KEY_DIR=/Users/arjan/.ec2

7. export EC2_PRIVATE_KEY=${EC2_KEY_DIR}/pk-

4P54TBID4E42U5ZMMCIZWBVYXXN6U6J3.pem

8. export EC2_CERT=${EC2_KEY_DIR}/cert-4P54TBID4E42U5ZMMCIZWBVYXXN6U6J3.pem

Page 24: X1 Dev Club - Amazon EC2 et al

Launch EC2 instance1. # create the key pair

2. $ ec2-add-keypair arjan

3. # create a security group called 'web'

4. $ ec2-add-group web -d 'All public facing web (port 80 and 443) instances'

5. $ ec2-authorize web -P tcp -p 22 -s 0.0.0.0/0

6. $ ec2-authorize web -P tcp -p 80 -s 0.0.0.0/0

7. $ ec2-authorize web -P tcp -p 443 -s 0.0.0.0/0

8. # launch an instance

9. $ ec2-run-instances ami-714ba518 \

--instance-count 1 \

--instance-type m1.small \

--key arjan \

--group web

Page 25: X1 Dev Club - Amazon EC2 et al

Links● http://media.corporate-ir.net/media_files/irol/97/97664/reports/Shareholderletter97.pdf● http://retailindustry.about.com/od/frontlinemanagement/a/Amazon_CEO_Jeff_Bezos_quotes.htm● http://en.wikipedia.org/wiki/Jeff_Bezos● http://www.saasblogs.com/saas/demystifying-the-cloud-where-do-saas-paas-and-other-acronyms-fit-in/● http://en.wikipedia.org/wiki/Amazon_Web_Services● http://www.janakiramm.net/blog/overview-of-amazon-web-services● http://perfcap.blogspot.com/2011/03/understanding-and-using-amazon-ebs.html● http://blog.rightscale.com/2008/08/20/amazon-ebs-explained/● http://www.slideshare.net/AmazonWebServices/aws-tech-summit-berlin-2011-keynote● Programming Amazon EC2 by Jurg van Vliet and Flavia Paganelli, 2011● Python and AWS Cookbook by Mitch Garnaat, 2012