Monday, March 30, 2009

HOWTO Run an Instance of Cloud Computing (UBUNTU)

HOWTO Run an instance of Cloud Computing (UBUNTU)

1.- Install EC2 CommandLine Tool

Steps here: http://wmunguiam.blogspot.com/2009/03/howto-install-amazon-ec2-command-line.html

2.- Verify the requirements

SSH client (Open SSH) (Linux-installed by default)
JAVA Runtime Enviroment (Version 5 or later)
wmunguiam@server:~/EC2$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

3.- Launch the instance (Using EPC with .euca directory)
wmunguiam@server:~/.euca$ source ~/.euca/eucarc

4.- Testing Tools installed
wmunguiam@server:~/.euca$ ec2-describe-availability-zones
PD: If you receive the following message, set JAVA_HOME environment variable.

/home/wmunguiam/EC2/ec2-api-tools-1.3-34128//bin/ec2-cmd: line 17:
JAVA_HOME: JAVA_HOME is not set
Try:
wmunguiam@server:~$ locate /rt.jar
/usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/rt.jar
/usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/rt.jar
/usr/lib/jvm/jdk1.5.0_16/jre/lib/rt.jar

wmunguiam@server:~$ export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07/
OR
wmunguiam@server:~$ vim /home/wmunguiam/.bashrc
Adding: export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07

ERROR 2: Connection Failed
wmunguiam@server:~/.euca$ ec2-describe-availability-zones
Server: Binding 'ec2_amazonaws_com_doc_2009_03_01' not found for class edu.ucsb.eucalyptus.msgs.RunInstancesType

Try: wmunguiam@server:~/.euca$ export EC2_URL=https://mayhem9.cs.ucsb.edu:8443/


ERROR 3: SSL Error

wmunguiam@server:~/.euca$ ec2-describe-availability-zones
Unexpected error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:187)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:181)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:975)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:123)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:516)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:454)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:104)
at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
at org.apache.commons.httpclient.methods.ByteArrayRequestEntity.writeRequest(ByteArrayRequestEntity.java:89)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:369)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
at org.codehaus.xfire.client.Client.invoke(Client.java:336)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy12.describeAvailabilityZones(Unknown Source)
at com.amazon.aes.webservices.client.Jec2.describeAvailabilityZones(Jec2.java:1474)
at com.amazon.aes.webservices.client.Jec2.describeAvailabilityZones(Jec2.java:1445)
at com.amazon.aes.webservices.client.cmd.DescribeAvailabilityZones.invokeOnline(DescribeAvailabilityZones.java:49)
at com.amazon.aes.webservices.client.cmd.BaseCmd.invoke(BaseCmd.java:654)
at com.amazon.aes.webservices.client.cmd.DescribeAvailabilityZones.main(DescribeAvailabilityZones.java:58)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:285)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:191)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:954)
... 33 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:280)
... 39 more








3 comments:

  1. Hi, Walter,

    Do you have any suggestions for the SSL errors? Much appreciated. Thanks!

    ReplyDelete
  2. Nevermind. I found out that the EC2 API tools I was using was TOO recent. Should use 1.3-30349 which can be found here:

    http://s3.amazonaws.com/ec2-downloads/ec2-api-tools-1.3-30349.zip

    ReplyDelete
  3. Dear yuletak,

    You are right!
    nice advise!

    ReplyDelete