惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
Project Zero
Project Zero
博客园 - 聂微东
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
Jina AI
Jina AI
C
Check Point Blog
博客园_首页
The GitHub Blog
The GitHub Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
A
Arctic Wolf
博客园 - 三生石上(FineUI控件)
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
Schneier on Security
Schneier on Security
K
Kaspersky official blog
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
S
Security Affairs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Register - Security
The Register - Security
P
Proofpoint News Feed
小众软件
小众软件
S
Securelist
T
Tor Project blog

博客园 - Kiki

美国发音规则 《组织行为学》词汇表 软件测试工程师的招聘体会(一) 软件测试工程师的招聘体会(二)谈谈毕业生如何面试软件工程师 如何做报表测试 Amazon EC2之初体验(二) Rational工具 一个尚未发现bug的小程序 我的测试人才培养之道 测试工程师的十二宗最 英文Windows无法打开中文名CHM文件的解决方法 HTML-based模式和URL-based模式的区别 (翻译)程序员的程序不工作时他们最常说的20个回复 (翻译)功能测试解决方案的评估报告 (翻译)图形用户界面 (转贴※整理)翻译的心得 (翻译)如何编写更佳的bug report (翻译)加入俱乐部吧 我对PMP考试的一些体会
Amazon EC2之初体验(一)
Kiki · 2007-08-21 · via 博客园 - Kiki

Amazon EC2之初体验

由于项目的需要,这几个月都在使用AmazonEC2。这个东西对于国内的用户来说比较陌生,但是听国外的同事说,这个在美国可是相当流行。这里简单介绍一下,大家有兴趣也可以试试。

EC2全称Amazon Elastic Compute Cloud,是Amazon2006年推出的新一代hosting服务,目前尚处于beta阶段,但是使用中没有发现什么问题,相当稳定。

EC2的功能介绍:http://www.amazon.com/gp/browse.html?node=201590011

要用EC2,有两个概念必须先了解。

Amazon Machine Image (AMI) - An Amazon Machine Image (AMI) is an encrypted file stored in Amazon S3. It contains all the information necessary to boot instances of your software.

Instance - The running system based on an AMI is referred to as an instance. All instances based on the same AMI begin executing identically. Any information on them is lost when the instances are terminated or if they fail.

EC2有个大概了解之后,就可以开始在网上申请使用此项服务了。

1.         首先必须先在Amazon Web Services上注册一个用户http://www.amazon.com/gp/browse.html?node=3435361

2.         注册完毕后,回到Amazon Web Services页面,点击左边Browse Web Services中的Amazon Elastic Compute Cloud (Beta),然后在EC2页面中,点击右边的Sign Up For This Web Service。这时系统会显示一个收费列表(如下)及要求你输入你的支付方式。

Instances

$0.10 per instance-hour consumed (or part of an hour consumed)

Data Transfer

$0.10 per GB - all data transfer in

$0.18 per GB - first 10 TB / month data transfer out

$0.16 per GB - next 40 TB / month data transfer out

$0.13 per GB - data transfer out / month over 50 TB

可以看到EC2完全按你的需要收费。如果需要多个实例,就可以多开几个,不需要了就关了,没有传统hosting的固定合同。

里面还提到Amazon的另一个服务Amazon Simple Storage Service ,简称Amazon S3,主要用于存贮数据。EC2是不负责储存的,每次instance关掉重启除/mnt外所有数据还原成VM镜像的初始状态,/mnt则被清空。储存由S3 (Amazon Simple Storage Service)服务负责。可以看看我的帐单。

Instance基本硬件配置:Xen VM2G CPU 1.7G RAM, 文件系统Ext3: 10G /(镜像持久), 140G /mnt(每次重启被清空)。

OS主要为LinuxWindows,可以从http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=101挑选自己需要的已经有的AMI

用户注册后,准备使用它了,这里有几项前提条件。

l         下载并安装最新的Java Runtime Environment from http://java.sun.com/javase/downloads/index_jdk5.jsp

l         下载Amazon EC2 command-line tools from: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&categoryID=88

"Resource Center"->”Amazon Elastic Compute Cloud (Beta) “->"Developer Tools".

l         下载PuTTY & PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

设置工具

1.      C盘下创建一个文件夹来存储和EC2相关的东西,如c:\EC2(当然不一定要在C盘)

2.      创建并下载private key文件和X.509 certificate

"Your Web Services Account"->" AWS Access Identifiers"

-> X.509 Certificate 里的"Create New", 保存他们到c:\EC2,命名为"privatekey.pem" and "509certificate.pem"

3.      c:\EC2下创建一个bat文件

@echo off

set EC2_HOME=c:\EC2

set PATH=%PATH%;%EC2_HOME%\bin

set EC2_PRIVATE_KEY=c:\ec2\PrivateKey.pem

set EC2_CERT=c:\ec2\509certificate.pem

set JAVA_HOME=C:\Program Files\Java\jre1.6.0_02

"%JAVA_HOME%\bin\java" -version

4.      解压缩Amazon EC2 command-line tools工具并且将/lib/bin文件夹移至c:\EC2下。这样在EC2目录下就有两个文件夹,一个bat文件和2个认证文件。

5.      在运行中输入CMD,切换至c:\EC2,然后运行

C:\EC2>ec2

java version "1.6.0_02"

Java(TM) SE Runtime Environment (build 1.6.0_02-b06)

Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, sharing)