Databases Reference
In-Depth Information
An analogous version for Windows is in listing 9.2. You can run it in a command prompt
by executing ec2-init.bat.
Listing 9.2 ec2-init.bat: a Windows script setting up variables for EC2 tools
set JAVA_HOME = "C:\Program Files\Java\jdk1.6.0_08"
set EC2_HOME = "C:\Program Files\Hadoop\aws\ec2-api-tools-1.3-30349"
set PATH = %PATH%;%EC2_HOME%\bin;%HADOOP_HOME%\src\contrib\ec2\bin
set EC2_PRIVATE_KEY = c:\ec2\pk-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem
set EC2_CERT = c:\ec2\cert-HKZYKTAIG2ECMXYIBH3HXV4ZBZQ55CLO.pem
If you'll be working with AWS often, you may choose to not use a separate script and
instead integrate it directly into your operating system's start-up script (for example,
.profile and autoexec.bat ).
The pathnames in the script will be different for your particular installation. The
environment variable JAVA_HOME needs to be set for the AWS command line tools
to work. We set it here although most likely it has already been set elsewhere. The
script adds the command line tools' bin directory to your system PATH . This makes
executing the tools much easier, as you don't need to specify the full path every time.
The Hadoop EC2 tools' directory is also added to PATH , although we won't cover them
until the next section.
AWS has machines located in different regions of the world. As of this writing, AWS
supports two regions, the U.S. and the E.U. As an optional step, you can choose which
region to run your EC2 instances to reduce latency. After you have run the preceding
script to set up the environment variables, let's run our first AWS command line tool
to ask Amazon what regions are currently available:
ec2-describe-regions
You'll get back something like this:
REGION us-east-1 us-east-1.ec2.amazonaws.com
REGION eu-west-1 eu-west-1.ec2.amazonaws.com
The second column is the region names (us-east-1 and eu-west-1) and the third
column is the corresponding service endpoints . The default region is us-east-1. Set the
environment variable EC2_URL to the service endpoint of a different region if you
choose to. You can do this within the preceding AWS initialization shell script.
TIP Besides the official command line tools, there are also GUI tools for
managing your EC2 and S3 usage. These GUI tools tend to be more user-
friendly. Two of the more popular ones are both Firefox extensions: Elasticfox
and S3Fox. Elasticfox ( http://developer.amazonwebservices.com/connect/
entry.jspa?entryID=609 ) provides basic EC2 management features, such
as launching new EC2 instances and listing currently running ones. S3Fox
( http://www.suchisoft.com/ext/s3fox.php ) is a third-party tool for organizing
your S3 storage. It functions much like a GUI-based FTP client in managing
remote storage.
 
 
Search WWH ::




Custom Search