个人工具

“UbuntuHelp:EC2StartersGuide”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第20行: 第20行:
 
</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>
 
</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 ===
 
=== Getting the images ===
 
The Official AMI Ids are the following:
 
The Official AMI Ids are the following:
第25行: 第26行:
 
| Version || Availability Zone || x86 || x86_64  
 
| Version || Availability Zone || x86 || x86_64  
 
|-
 
|-
| Intrepid || US || ami-5059be39 || ami-255bbc4c
+
| Karmic || US/Europe || [http://uec-images.ubuntu.com/releases/karmic ubuntu releases] || [http://uec-images.ubuntu.com/releases/karmic ubuntu releases]
 
|-
 
|-
| Intrepid || Europe || ami-80c0e8f4 || ami-84c0e8f0
+
| 8.10 (Intrepid) || US || ami-5059be39 || ami-255bbc4c
 
|-
 
|-
| Hardy || US || ami-5d59be34 || ami-2959be40
+
| 8.10 (Intrepid) || Europe || ami-80c0e8f4 || ami-84c0e8f0
 
|-
 
|-
| Hardy || Europe ||  ami-30c0e844 || ami-3ac0e84e  
+
| 8.04 (Hardy) || US || ami-5d59be34 || ami-2959be40
 +
|-
 +
| 8.04 (Hardy) || Europe ||  ami-30c0e844 || ami-3ac0e84e  
 
|}
 
|}
 +
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 ===
 
=== 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]].
 
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]].
第76行: 第80行:
 
</nowiki></pre>
 
</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:
 
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
+
* [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>
 
<ol><li>To see the status of your instance, you can run the following command:</li></ol>
  

2009年11月17日 (二) 18:58的版本

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 Amazon Web Services requires you to go through the following steps that are described below:

  1. Create your account on Amazon (if you do not already have one) and setup your keys
  2. Install Amazon EC2 API Tools
  3. Instantiate your images(s)
  4. Configure your instance

<<Anchor(amazon_account_setup)>>

Setting up an Amazon account

  1. Go to http://aws.amazon.com, and select Sign-up Now. Sign in to your existing Amazon account or create a new one.
  2. Go to http://aws.amazon.com/ec2, and select "Sign Up for Amazon EC2".
    1. Enter your credit card information.
    2. Complete your signup for the Amazon EC2 service.
  3. 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.
    1. Select "Yes" to create a new certificate.
    2. Download your Private Key and Certificate file.
    3. 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.

    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:

    Version Availability Zone x86 x86_64
    Karmic US/Europe ubuntu releases ubuntu releases
    8.10 (Intrepid) US ami-5059be39 ami-255bbc4c
    8.10 (Intrepid) Europe ami-80c0e8f4 ami-84c0e8f0
    8.04 (Hardy) US ami-5d59be34 ami-2959be40
    8.04 (Hardy) Europe ami-30c0e844 ami-3ac0e84e

    Unofficial but well-maintained AMIs (8.04 Hardy through 9.04 Jaunty) are available from Eric Hammond's site 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 here.

    1. Make sure you have|multiverse enabled and run the following command:
    sudo apt-get install ec2-api-tools
     
    1. 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:
    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/
    
    1. Check to see if it's working by running the following command:
    ec2-describe-images -o self -o amazon
    

    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.

    1. 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:
    ec2-add-keypair ec2-keypair > ec2-keypair.pem
    
    1. Make sure the permissions on the file is 600
    chmod 600 ec2-keypair.pem
    

    Using the Ubuntu Images

    The images and kernel are public, so they do not require any registration. To start using the AMI:

    1. Start the images you want using one of the following commands:

    32 bits:

    ec2-run-instances ami-xxxxx -k ec2-keypair
    

    64 bits:

    ec2-run-instances ami-xxxxx -k ec2-keypair -t c1.xlarge
    

    where ami-xxxxx is the AMI ID found in the above table, and -t is the type of image:

    1. To see the status of your instance, you can run the following command:
    ec2-describe-instances
    
    1. Authorize network access to the ssh port by running the following commands:
    ec2-authorize default -p 22
    
    1. To login to your instance you have to run the following command:
    ssh -i /path/to/ec2-keypair.pem ubuntu@<external-host-name>
    

    Using the external host name that was listed as a result of the ec2-describe-instances command.

    1. And, of course, you're being billed as long the host is running<<FootNote(The package 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.
    ec2-terminate-instances <instance_id>
    

    See Also

    Footnotes