个人工具
登录
查看“UbuntuHelp:EC2StartersGuide”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:EC2StartersGuide”的源代码
来自Ubuntu中文
←
UbuntuHelp:EC2StartersGuide
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/EC2StartersGuide}} {{Languages|UbuntuHelp:EC2StartersGuide}} === Introduction === This page gives you the first keys to using Ubuntu's official images on Amazon EC2. Please follow the instructions below to use them. Running Ubuntu Server Edition on [http://aws.amazon.com/ Amazon Web Services] requires you to go through the following steps that are described below: <ol><li>Create your account on Amazon (if you do not already have one) and setup your keys </li><li>Install Amazon EC2 API Tools </li><li>Instantiate your images(s) </li><li>Configure your instance</li></ol> <<Anchor(amazon_account_setup)>> === Setting up an Amazon account === <ol><li>Go to http://aws.amazon.com, and select Sign-up Now. Sign in to your existing Amazon account or create a new one. </li><li>Go to http://aws.amazon.com/ec2, and select "Sign Up for Amazon EC2". <ol><li>Enter your credit card information. </li><li>Complete your signup for the Amazon EC2 service. </li></ol></li><li>On the thank you page, select "Create a New X.509 Certificate". Note that if you already have an X.509 certificate you are only able to download the certificate itself, not the private key. If you no longer have the private key you will need to generate a new X.509 certificate. <ol><li>Select "Yes" to create a new certificate. </li><li>Download your Private Key and Certificate file. </li><li>Note your AWS account ID # by going to http://aws.amazon.com/ec2 by moving the mouse over "Your Web Services Account" and select "Your Account Activity". Your account number will be at the top of this page in XXXX-XXXX-XXXX format.</li></ol> If at a later time you discover you need to generate a new X.509 certificate, click on "Your Account" at the top of the EC2 console page. You may need to click the small button with two down arrows near the top right of the EC2 console page to make the "Your Account" link visible. Then in the "Access Credentials" box, click the tab named "X.509 Certificates" and click "Create a New Certificate". Download the private key and certificate when prompted. === Getting the images === The Official AMI Ids are the following: {|border="1" cellspacing="0" |Release ||Region ||i386 ||x86_64 |- |'''9.10'''>Karmic Koala || us-east-1 || ami-bb709dd2 || ami-55739e3c |- | us-west-1 || ami-c32e7f86 || ami-cb2e7f8e |- | eu-west-1 || ami-2fc2e95b || ami-05c2e971 |- |'''8.04'''>Hardy Heron|| us-east-1 || ami-59b35f30 || ami-27b35f4e |- | us-west-1 || ami-3954057c || ami-c954058c |- | eu-west-1 || ami-a1d9f2d5 || ami-add9f2d9 |- |Lucid Lynx || [http://uec-images.ubuntu.com/releases/10.04/release/ Release] |} Unofficial but well-maintained AMIs (8.04 Hardy through 9.04 Jaunty) are available from Eric Hammond's site [http://alestic.com/ Alestic.com]. === Installing the API tools === The EC2 API tools is now available for 9.04 users to install and configure the software. For previous versions of Ubuntu please see [[UbuntuHelp:EC2APITools|here]]. <ol><li>Make sure you [[UbuntuHelp:Repositories/CommandLine#Adding_the_Universe_and_Multiverse_Repositories|have|multiverse enabled]] and run the following command:</li></ol> <pre><nowiki> sudo apt-get install ec2-api-tools </nowiki></pre> <ol><li>Make sure you have the following environment variables set up in your shell profile. This is accomplished by adding the following lines to your '''~/.bashrc''' if you use bash as your shell:</li></ol> <pre><nowiki> export EC2_PRIVATE_KEY=$HOME/<where your private key is>/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem export EC2_CERT=$HOME/<where your certificate is>/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/ </nowiki></pre> <ol><li>Check to see if it's working by running the following command:</li></ol> <pre><nowiki> ec2-describe-images -o self -o amazon </nowiki></pre> '''Note:''' If this fails due to "`Client.AuthFailure`" then ensure you have signed up for both AWS and ec2 with amazon.com, and have provided valid payment details. Also double check that the `EC2_PRIVATE_KEY` and `EC2_CERT` point to the correct locations. <ol><li>To use public AMIs you have to generate an ssh key. Run the following command which will also '''save''' the private key returned to a local file called '''ec2-keypair''':</li></ol> <pre><nowiki> ec2-add-keypair ec2-keypair > ec2-keypair.pem </nowiki></pre> <ol><li>Make sure the permissions on the file is 600</li></ol> <pre><nowiki> chmod 600 ec2-keypair.pem </nowiki></pre> === Using the Ubuntu Images === The images and kernel are public, so they do not require any registration. To start using the AMI: <ol><li>Start the images you want using one of the following commands:</li></ol> 32 bits: <pre><nowiki> ec2-run-instances ami-xxxxx -k ec2-keypair </nowiki></pre> 64 bits: <pre><nowiki> ec2-run-instances ami-xxxxx -k ec2-keypair -t c1.xlarge </nowiki></pre> where ami-xxxxx is the AMI ID found in the [[UbuntuHelp:EC2StartersGuide#Getting_the_images|above table]], and -t is the type of image: * [http://docs.amazonwebservices.com/AWSEC2/2009-03-01/DeveloperGuide/index.html?instance-types.html 2009-03-01 doc] [http://docs.amazonwebservices.com/AWSEC2/latest/DeveloperGuide/index.html?instance-types.html latest doc] * [http://aws.amazon.com/ec2/instance-types/ description of types] : [http://aws.amazon.com/ec2/#pricing pricing info] <ol><li>To see the status of your instance, you can run the following command:</li></ol> <pre><nowiki> ec2-describe-instances </nowiki></pre> <ol><li>Authorize network access to the ssh port by running the following commands:</li></ol> <pre><nowiki> ec2-authorize default -p 22 </nowiki></pre> <ol><li>To login to your instance you have to run the following command:</li></ol> <pre><nowiki> ssh -i /path/to/ec2-keypair.pem ubuntu@<external-host-name> </nowiki></pre> Using the external host name that was listed as a result of the '''ec2-describe-instances''' command. <ol><li>And, of course, you're being billed as long the host is running<<FootNote(The package [https://launchpad.net/screen-profiles screen-profiles] has an extension that allows to display a cost estimate on your host terminal session)>>, so you will probably want to shut it down when you're done.</li></ol> <pre><nowiki> ec2-terminate-instances <instance_id> </nowiki></pre> === See Also === * The [http://www.ubuntu.com/cloud official web page] for Ubuntu Cloud * The [[UbuntuHelp:EC2FAQ|EC2 Frequently Asked Questions]] * The [http://aws.amazon.com/resources/ Amazon Web Services documentation] === Footnotes === [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:EC2StartersGuide
。