1、Amazon EC2 Quick Start adapted from http:/ Elastic Compute Cloud (EC2),Amazon Machine Images (AMIs) are the basic building blocks of Amazon EC2 An AMI is a template that contains a software configuration (operating system, application server and applications) that can run on Amazons computing enviro
2、nment AMIs can be used to launch an instance, which is a copy of the AMI running as a virtual server in the cloud.,Getting Started with Amazon EC2,Step 1: Sign up for Amazon EC2 Step 2: Create a key pair Step 3: Launch an Amazon EC2 instance Step 4: Connect to the instance Step 5: Customize the inst
3、ance Step 6: Terminate instance and delete the volume created,Creating a key pair,AWS uses public-key cryptography to encrypt and decrypt login information. AWS only stores the public key, and the user stores the private key. There are two options for creating a key pair: Have Amazon EC2 generate it
4、 for youGenerate it yourself using a third-party tool such as OpenSSH, then import the public key to Amazon EC2,Generating a key pair with Amazon EC2,Open the Amazon EC2 console at http:/ On the navigation bar select region for the key pair Click Key Pairs in the navigation pane to display the list
5、of key pairs associated with the account,Generating a key pair with EC2 (cont.),Click Create Key Pair Enter a name for the key pair in the Key Pair Name field of the dialog box and click Create The private key file, with .pem extension, will automatically be downloaded by the browser.,Launching an A
6、mazon EC2 instance,Sign in to AWS Management Console and open the Amazon EC2 console at http:/ From the navigation bar select the region for the instance,Launching an Amazon EC2 instance (cont.),From the Amazon EC2 console dashboard, click Launch Instance,Launching an Amazon EC2 instance (cont.),On
7、the Create a New Instance page, click Quick Launch Wizard In Name Your Instance, enter a name for the instance In Choose a Key Pair, choose an existing key pair, or create a new one In Choose a Launch Configuration, a list of basic machine configurations are displayed, from which an instance can be
8、launched Click continue to view and customize the settings for the instance,Launching an Amazon EC2 instance (cont.),Select a security group for the instance. A Security Group defines the firewall rules specifying the incoming network traffic delivered to the instance. Security groups can be defined
9、 on the Amazon EC2 console, in Security Groups under Network and Security,Launching an Amazon EC2 instance (cont.),Review settings and click Launch to launch the instance Close the confirmation page to return to EC2 console Click Instances in the navigation pane to view the status of the instance. T
10、he status is pending while the instance is launchingAfter the instance is launched, its status changes to running,Connecting to an Amazon EC2 instance,There are several ways to connect to an EC2 instance once its launched. Remote Desktop Connection is the standard way to connect to Windows instances
11、.An SSH client (standalone or web-based) is used to connect to Linux instances.,Connecting to Linux/UNIX Instances from Linux/UNIX with SSH,Prerequisites:Most Linux/UNIX computers include an SSH client by default, if not it can be downloaded from openssh.org Enable SSH traffic on the instance (using
12、 security groups) Get the path the private key used when launching the instance In a command line shell, change directory to the path of the private key file Use the chmod command to make sure the private key file isnt publicly viewable,Connecting to Linux/UNIX Instances(cont.),Right click on the in
13、stance to connect to on the AWS console, and click Connect. Click Connect using a standalone SSH client. Enter the example command provided in the Amazon EC2 console at the command line shell,Transfering files to Linux/UNIX instances from Linux/UNIX with SCP,Prerequisites: Enable SSH traffic on the
14、instance Install an SCP client (included by default mostly) Get the ID of the Amazon EC2 instance, public DNS of the instance, and the path to the private key If the key file is My_Keypair.pem, the file to transfer is samplefile.txt, and the instances DNS name is ec2-184-72-204-pute-, the command be
15、low copies the file to the ec2-user home,Terminating Instances,If the instance launched is not in the free usage tier, as soon as the instance starts to boot, the user is billed for each hour the instance keeps running. A terminated instance cannot be restarted. To terminate an instance: Open the Am
16、azon EC2 console In the navigation pane, click Instances Right-click the instance, then click Terminate Click Yes, Terminate when prompted for confirmation,Google App Engine Quick Start adapted from https:/ App Engine (GAE),GAE lets users run web applications on Googles infrastructure GAE data stora
17、ge options are: Datastore: a NoSQL schemaless object datastore Google Cloud SQL: Relational SQL database service Google Cloud Storage: Storage service for objects and files All applications on GAE can use up to 1 GB of storage and enough CPU and bandwidth to support an efficient application serving
18、around 5 million page views a month for free. Three runtime environments are supported: Java, Python and Go.,Developing Java Applications on GAE,The easiest way to develop Java applications for GAE is to use the Eclipse development environment with the Google plugin for Eclipse. App Engine Java appl
19、ications use the Java Servlet standard for interacting with the web server environment. An applications files, including compiled classes, JARs, static files and configuration files, are arranged in a directory structure using the WAR standard layout for Java web applications.,Running a Java Project
20、,The App Engine SDK includes a web server application to test applications. The server simulates the complete GAE environment. The project can be run using the “Debug As Web Application” option of Eclipse or using Ant. After running the server, the application can be tested by visiting the servers U
21、RL in a Web browser.,Uploading an Application to GAE,Applications are created and managed using the Administration Console at https:/. Once an application ID is registered for an application, the application can be uploaded to GAE using the Eclipse plugin or a command-line tool in the SDK. After uploading, the application can be accessed from a Web browser. If a free account was used for registration, the URL for the application will be http:/app_ where app_id the application id assigned during registration.,