Showing posts with label ec2. Show all posts
Showing posts with label ec2. Show all posts

Sunday, July 5, 2009

Ant, SCP and EC2

I've have had to deal with a strange set of circumstances

1. No ant-jsh.jar in my deployment

I got the error

BUILD FAILED

Deploy.ant.xml:57: Problem: failed to create task or type scp

Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found.

This looks like one of Ant's optional components.

Action: Check that the appropriate optional JAR exists in

-/usr/share/ant/lib

-/Users/alvinrichards/.ant/lib

-a directory added on the command line with the -lib argument


Do not panic, this is a common problem.

The commonest cause is a missing JAR.


This is not a bug; it is a configuration problem

Turns out that the default deployment of Ant (1.7) did not contain this jar on Mac OS-x 10.5. So I had to do two things

  1. Download the binary distribution of Ant 1.7, unpack the jar and copy ant-jsch.jar to /usr/share/ant/lib
  2. Download the implementation of the SSH java code from JCraft and copy it to /usr/share/ant/lib


2. I still can't SCP to EC2

So I know I can scp -i to this EC2 host, but the following Ant task fails

<scp localfile="dba.war"

todir="root@xxxx:/usr/java/apache-tomcat-6.0.14/webapps/"

keyfile="xxxx-Amazon-LAMP-image-keypair">

with

BUILD FAILED

/Volumes/Develop/Develop/Projects/HarpoonDeployMK9a/Deploy.ant.xml:57: neither password nor passphrase for user root has been given. Can't authenticate.

Turns out that you need the following in the SCP task for it to work with EC2

trust="yes"

passphrase="xxx"

The passphrase that worked happened to be my password for my AWS account...

Wednesday, September 12, 2007

Amazon Web Service Startup Shindig

Amazon EC2 and S3


shapeimage_1-1.jpg
So I have been tracking Amazon Web Services for some time. So, being signed up I got an invite to a event at Stamford University (those who know me, I know, don’t get me started). It got me thinking about the whole decision about virtualization. It makes a great deal of sense for my application since it allows me to add compute resources as I needed them. However, I now have to manage (and learn) about a whole bunch of things I really don’t want to know about, from DNS to Cicso IOS... you get the picture.

So I thought wow, EC2 plus S3 makes a great deal of sense. Allows me to focus on my application and Amazon to manage the infra-structure for me. The cost is not that bad either, I reckon on about $20 / day to start with which is a lot less than building it myself. It also means that I get some location transparency and can manage on the road, which seem a big thing at the moment.

It just all means that the applications needs a little re-architecture!