<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ALTERthought Blogs &#187; Uncategorized</title>
	<atom:link href="http://alterlabs.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://alterlabs.com</link>
	<description>Results through imagination</description>
	<lastBuildDate>Tue, 13 Apr 2010 19:19:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Speaking @ PMI Fairview Park Forum</title>
		<link>http://alterlabs.com/uncategorized/speaking-pmi-fairview-park-forum/</link>
		<comments>http://alterlabs.com/uncategorized/speaking-pmi-fairview-park-forum/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 19:09:28 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[agile project management]]></category>
		<category><![CDATA[rapid planning]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://alterlabs.com/?p=602</guid>
		<description><![CDATA[On Wednesday, April 21st, Sunjay Pandey will be speaking at the Project Management Institute’s Fairview Park Forum .  Sunjay will be presenting a topic entitled Project Plan Ninja which discusses how to manage Rapid Business Requirements generation on a Rapid Application Development project.
Sunjay will be presenting proven techniques that can take your team from [...]]]></description>
			<content:encoded><![CDATA[<p>On Wednesday, April 21st, Sunjay Pandey will be speaking at the <a href="http://www.pmiwdc.org/Fairview" target="_blank" title="Fairview">Project Management Institute’s Fairview Park Forum</a> .  Sunjay will be presenting a topic entitled <a href="http://at.alterthought.com/project-plan-ninja" title="Project Plan Ninja">Project Plan Ninja</a> which discusses how to manage Rapid Business Requirements generation on a Rapid Application Development project.</p>
<p>Sunjay will be presenting proven techniques that can take your team from vision to requirements in hours, not weeks. </p>
<p><strong>Presentation Abstract</strong></p>
<p>Markets, customers, and industries are moving quickly. Rapid application development is a strategic necessity. But, rapid application development techniques require rapid estimation and planning techniques. Business demands for improved time-to-market means your teams must estimate, plan, and budget application development projects with greater speed and accuracy.</p>
<p>Project Plan Ninja provides modern cues, clues, and tools for turning application development requirements into actionable budgets &#038; work plans.</p>
<ul>
<li>Estimate application development projects in hours, not weeks</li>
<li>Quickly and confidently enter feature negotiation with customers</li>
<li>Envision a consistent estimation and budgeting process for your teams</li>
<li>Bridge the gap between Agile-oriented and plan-driven estimation</li>
<li>Understand how to build practical, repeatable work plans</li>
</ul>
<p>There is no charge for attending this event, but preregistration is required.   Please visit <a href="http://www.pmiwdc.org/Fairview" target="_blank" title="Fairview">www.pmiwdc.org/Fairview</a> and click on “Register Online” on the April 21 event.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/uncategorized/speaking-pmi-fairview-park-forum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking @ Norfolk Area PMI Dinner Group</title>
		<link>http://alterlabs.com/uncategorized/speaking-norfolk-area-pmi-dinner-group/</link>
		<comments>http://alterlabs.com/uncategorized/speaking-norfolk-area-pmi-dinner-group/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 15:37:26 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alterlabs.com/?p=588</guid>
		<description><![CDATA[On Wed Oct 7th, Sunjay Pandey will be speaking at the Project Management Institute’s Norfolk Dinner Meeting.  Sunjay will be presenting the topic: The Switching Gears Factor which describes portions of ALTERthought’s IT Governance approaches &#8211; particularly estimation and budgeting.  In this session, Sunjay will discuss how the multi-tasking arising from multi-project assignments [...]]]></description>
			<content:encoded><![CDATA[<p>On Wed Oct 7th, Sunjay Pandey will be speaking at the <a href="http://pmihr.org/index.php?option=com_events&#038;task=view_detail&#038;agid=185&#038;year=2009&#038;month=10&#038;day=07&#038;Itemid=26" title="Norfolk PMI">Project Management Institute’s Norfolk Dinner Meeting</a>.  Sunjay will be presenting the topic: <a href="http://alterlabs.com/general/articles/the-switching-gears-factor/">The Switching Gears Factor</a> which describes portions of ALTERthought’s IT Governance approaches &#8211; particularly estimation and budgeting.  In this session, Sunjay will discuss how the multi-tasking arising from multi-project assignments can impact IT projects. He will also discuss how it can  be accounted for and how to manage this impact. Registration is available <a href="http://guest.cvent.com/i.aspx?4W,M3,10e1917e-3612-4277-a506-672c2611faa6">online</a>. We look forward to seeing you there.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/uncategorized/speaking-norfolk-area-pmi-dinner-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails and Cloud Computing: Part 1 &#8211; Amazon EC2</title>
		<link>http://alterlabs.com/uncategorized/grails-and-cloud-computing-part-1-amazon-ec/</link>
		<comments>http://alterlabs.com/uncategorized/grails-and-cloud-computing-part-1-amazon-ec/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 15:24:27 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Agile Development]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Groovy/Grails]]></category>
		<category><![CDATA[How-Tos]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://alterlabs.com/?p=135</guid>
		<description><![CDATA[Progress to Date
This entry is a part of the &#8216;What can you build in 40hrs&#8216; series&#8211; which, in a nutshell, involved an experiment to see what we could build in about typical weeks worth of work.  In the last post we effectively completed the basic functional requirements of the application, and now have a [...]]]></description>
			<content:encoded><![CDATA[<h3>Progress to Date</h3>
<p>This entry is a part of the &#8216;<em>What can you build in 40hrs</em>&#8216; series&#8211; which, in a nutshell, involved an experiment to see what we could build in about typical weeks worth of work.  In the <a href="http://alterlabs.com/technologies/java/grails-app-in-40-hrs-part-5/">last post</a> we effectively completed the basic functional requirements of the application, and now have a working system that can be used to manage two sets of to-do lists as part of a task management application.</p>
<h3>Cloud Computing</h3>
<p>As part of this effort, we wanted to try something &#8216;new&#8217; as part of the application initiative. We decided to make one of the system requirements of the application involve its deployment into a Cloud Computing infrastructure&#8211; the leading candidates at time of construction being <a href="http://aws.amazon.com/ec2/">Amazon&#8217;s Elastic Cloud Computing (EC2</a>) and Google&#8217;s App Engine.  </p>
<p>While both Amazon and Google offer similar infrastructure platforms, as it shall be seen, the level of effort necessary to deploy a stock Grails application into these infrastructures varies greatly.<br />
<span id="more-135"></span><br />
This entry concerns itself with the deployment of the <em>TwoDo</em> application into Amazon&#8217;s EC2 infrastructure.  A subsequent entry will detail the efforts necessary to get the same application running on Google&#8217;s AppEngine platform. (At the time I started this effort Google&#8217;s AppEngine had only recently released its Java API, and was dribbling out access to its infrastructure in a controlled fashion (FIFO?) As such, I did not initially have the rights to deploy an application to AppEngine&#8211; hence the decision to go with EC2 first.)</p>
<h3>Cloud Tools Plugin</h3>
<p>We are going to leverage the <a href="http://code.google.com/p/cloudtools/">CloudTools Plugin</a> for all the heavy lifting aspects of getting our application deployed into Amazon.  Cloud Tools was developed by the founder of <a href="http://www.cloudfoundry.com/">CloudFoundry</a>&#8211; a service designed to deploy Java/Grails apps to Amazon&#8217;s EC2.  I suppose I could have gone with the CloudFoundry as part of my deployment efforts (and indeed, will probably try it out) but for whatever reason chose to start at a lower level by using the plugin.</p>
<div class="strongpoint">
<strong>Footnote:</strong> In the elapse time since I started the project and the authoring of this post, <a href="http://chris-richardson.blog-city.com/cloud_foundry_is_now_part_of_springsource.htm">SpringSource has acquired CloudFoundry</a> as part of its Cloud Computing push. Exciting stuff!
</div>
<h3>Getting Started</h3>
<p>A prerequisite for using the <em>CloudTools Plugin</em> is to have an existing Amazon AWS account. The setup of which is easy, and well documented outside of this blog&#8230; so we aren&#8217;t going to concern ourselves with much of it here. If nothing else simply go to the <a href="http://aws.amazon.com/ec2/">main site</a> and click the &#8216;Sign Up for Amazon EC2&#8242; button</p>
<div class="strongpoint">
It should be stressed that the use of Amazon&#8217;s EC2 infrastructure is not free. Registration and setup on Amazon&#8217;s site requires a form of payment to be associated with your account.
</div>
<p>The first basic step was to install the plugin. I downloaded the plugin from the main <em>CloudTools</em> site and installed it from my local drive:</p>
<blockquote><p><em>grails install-plugin /path/to/downloads/grails-cloud-tools-0.6.zip </em>
</p></blockquote>
<p>The installation process creates a<code> conf/CloudTools.groovy</code> file which, in theory, could be simply added to the list of configuration files that Grails should slurp during boot time via an explicit specification in the <code>conf/Config.groovy</code> file like so:</p>

<div class="wp_syntax"><div class="code"><pre class="1" style="font-family:monospace;">...
grails.config.locations = [&quot;classpath:CloudTools.groovy&quot;]
..</pre></div></div>

<p>However, I could never get this file to be located during the deployment process, so I eventually punted and copied the contents of the <code>conf/CloudTools.groovy</code> file directly into <code>conf/Config.groovy</code></p>
<p>Once the contents of the <code>conf/CloudTools.groovy</code> file are pasted into the standard <code>conf/Config.groovy</code> file it needs to be edited with the specifics of our application. </p>
<h4>Database Setup</h4>
<p>The <em>CloudTools plugin</em> will create a MySql schema for us, as well as a user account used to access the DB as part of the deployment process. All we need to to is edit the parameters passed to the schema() method of the ClusterSpec() object that we pasted into our Config.groovy file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;">cloudTools <span style="color: #66cc66;">&#123;</span>
...
  <span style="color: #006600;">clusterSpec</span> <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClusterSpec<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      .<span style="color: #006600;">tomcats</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
      .<span style="color: #006600;">topology</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;SingleInstanceTopology&quot;</span><span style="color: #66cc66;">&#41;</span>
       .<span style="color: #006600;">instanceType</span><span style="color: #66cc66;">&#40;</span>EC2InstanceType.<span style="color: #006600;">SMALL</span><span style="color: #66cc66;">&#41;</span>
       .<span style="color: #006600;">slaves</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
       .<span style="color: #006600;">bucketPrefix</span><span style="color: #66cc66;">&#40;</span><span style="color: #aaaadd; font-weight: bold;">System</span>.<span style="color: #006600;">getProperty</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;grails.env&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
       .<span style="color: #006600;">catalinaOptsBuilder</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&quot;&quot;{builder, databasePrivateDnsName, slaves -&gt;</span>
<span style="color: #ff0000;">            builder.arg(&quot;-Xmx500m&quot;)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;com.sun.management.jmxremote&quot;)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;com.sun.management.jmxremote.port&quot;, 8091)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;com.sun.management.jmxremote.authenticate&quot;, false)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;com.sun.management.jmxremote.ssl&quot;, false)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;ptrack.application.environment&quot;, &quot;ec2&quot;)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;log4j.configuration&quot;, &quot;log4j-minimal.properties&quot;)</span>
<span style="color: #ff0000;">	    builder.prop(&quot;jdbc.db.server&quot;, databasePrivateDnsName)}&quot;&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="display:block;background-color: #ffc;">        .<span style="color: #006600;">schema</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;blogtwodo&quot;</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;twodouser&quot;</span>: <span style="color: #ff0000;">&quot;password&quot;</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span></span></pre></td></tr></table></div>

<p>On <strong>line 18</strong> above we configure the <code>ClusterSpec</code> to create the &#8216;<em>blogtwo</em>&#8216; database and the &#8216;<em>twodouser</em>&#8216;, the specifications of which should match the contents of the <code>conf/DataSource.groovy</code> file.</p>
<h4>CloudTools AWS Properties File</h4>
<p> We need to indicate the location of our Amazon Web Service <a href="http://code.google.com/p/cloudtools/wiki/AwsPropertiesFile">property file</a>, which is set by editing the value for the <code>awsPropertiesFile</code> property within the <code>conf/Config.groovy</code> file.</p>

<div class="wp_syntax"><div class="code"><pre class="groovy" style="font-family:monospace;">...
<span style="color: #006600;">cloudTools</span> <span style="color: #66cc66;">&#123;</span>
<span style="display:block;background-color: #ffc;">  awsPropertiesFile <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;etc/ec2.properties&quot;</span></span>  ...
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>As you can see we have created a new <code>grails-app/etc</code> directory to hold this new file.  The properties file is a <em>CloudTools</em> specific artifact that  contains the relevant configuration information required by Amazon to host our application. In order to deploy into Amazon&#8217;s platform we are going to need provide several bits of information by way of this properties file.  Let&#8217;s take a look at the contents of ours and dissect it line-by-line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="robots" style="font-family:monospace;">imageId.m1.small=ami-6f2cc906
imageId.m1.large=ami-0129cc68
imageId.m1.xlarge=ami-0129cc68
accountId=XXXX-XXXX-XXXX
accessKey=XXXXXXXXXXXXXXXXXXX
secretKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
keyName=blogtwodo
keyPairFile=/Users/don/DevelopmentWork/blogtwodo/etc/blogtwodo.pem
sshDir=/usr/bin</pre></td></tr></table></div>

<p><strong>AMI Identification</strong><br />
An application deployed into the EC2 will reside in <strong>Amazon Machine Image (AMI)</strong>. Think of this as a identifier for the base OS image/VPS.  In our case (<strong>lines 1-3</strong>) we will simply use the ones specified by the plugin <a href="http://code.google.com/p/cloudtools/wiki/AwsPropertiesFile">documentation</a>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="robots" style="font-family:monospace;">imageId.m1.small=ami-6f2cc906
imageId.m1.large=ami-0129cc68
imageId.m1.xlarge=ami-0129cc68</pre></td></tr></table></div>

<p><strong>Security Credentials</strong><br />
The next few lines contain part of the security credentials we need to provide to Amazon.  From within the Amazon Web Services Console, we navigate to &#8216;<em>Your Account -> Security Credentials</em>&#8216;.  The <code>accountId</code> (<strong>line 4)</strong> is your 12-digit account displayed on this page under the &#8216;<em>Your AWS Account ID, E-mail Address and Password</em>&#8216; section.</p>
<p>While within the &#8216;<em>Access Keys</em>&#8216; tab, I clicked &#8216;<em>Create a New access Key</em>&#8216; and used the resulting generated information to fill in the <code>accessKey</code> (<strong>line 5</strong>) and secretKey (<strong>line 6</strong>) properties.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>4
5
6
</pre></td><td class="code"><pre class="robots" style="font-family:monospace;">accountId=XXXX-XXXX-XXXX
accessKey=XXXXXXXXXXXXXXXXXXX
secretKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</pre></td></tr></table></div>

<p>Amazon&#8217;s site does a good job describing the purpose of the above access credentials:</p>
<blockquote><p>
<em><strong>Access Key ID</strong><br />
Your Access Key ID identifies you as the party responsible for service requests. Use your Access Key ID as the value of the AWSAccessKeyId parameter in requests you send to Amazon Web Services (when required).</em></p>
<p><em><strong>Secret Access Key</strong><br />
Each Access Key ID has a Secret Access Key associated with it. Use your Secret Access Key to calculate a signature to include in requests to web services that require authenticated requests. Your Secret Access Key is a secret, and should be known only by you and AWS. You should never include your Secret Access Key in your requests to AWS. You should never e-mail your Secret Access Key to anyone. It is important to keep your Secret Access Key confidential to protect your account. </em>
</p></blockquote>
<p><strong>Key Pair</strong><br />
 In addition to the above credentials we need to provide a public/private key pair in the form of an PEM file. Keys are created from within the EC2 dashboard and I created a new keypair with the application name of &#8216;blogtwodo&#8217; by logging into the &#8216;<em>Amazon EC2 dashboard -> Key Pairs</em>&#8216; and clicking the &#8216;<em>Create Key Pair</em>&#8216; link. The resulting <em>blogtwodo.pem</em> file was saved locally and moved into the <code>grails-app/etc</code> directory, where its configured by <strong>lines 7 and 8</strong> below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>7
8
</pre></td><td class="code"><pre class="robots" style="font-family:monospace;">keyName=blogtwodo
keyPairFile=/Users/don/DevelopmentWork/blogtwodo/etc/blogtwodo.pem</pre></td></tr></table></div>

<p>Finally we need to indicate the path to an ssh client (<strong>line 9</strong>) to be used to securely upload our application to Amazon. I am using OSX on a Mac which includes this natively in the <code>/usr/bin</code> directory:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
</pre></td><td class="code"><pre class="robots" style="font-family:monospace;">sshDir=/usr/bin</pre></td></tr></table></div>

<h3>Deployment</h3>
<p>OK. With our configuration out of the way lets try and deploy this thing. From the command line we invoke the gant deployment target added by the <em>CloudTools</em> plugin:</p>
<blockquote><p><em>grails cloud-tools-deploy</em>
</p></blockquote>
<p>&#8230; which promptly reports the following error:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">Error executing script CloudToolsDeploy<span style="color: #66cc66;">:</span> No such property<span style="color: #66cc66;">:</span> DEFAULT_J5_DEPS for class<span style="color: #66cc66;">:</span> ExplodedWar_groovy</pre></div></div>

<p>Whats the deal? Well, the <em>CloudTools</em> plugin was developed pre Grails v1.1.1, as it turns out there  are a few incompatibilities that need to be addressed in order to get our application deployed.</p>
<p>This error is addressed by adding the following highlighted code (<strong>line 10</strong>) to the <code>$GRAILS_HOME/scripts/_GrailsWar.groovy</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;">...
<span style="color: #006600;">DEFAULT_DEPS</span> <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#91;</span>
    <span style="color: #ff0000;">&quot;ant-*.jar&quot;</span>,
     ...
     ...
<span style="color: #66cc66;">&#93;</span>
&nbsp;
DEFAULT_J5_DEPS <span style="color: #66cc66;">=</span> DEFAULT_DEPS</pre></td></tr></table></div>

<p>OK. Lets try to deploy again&#8230;.. this time, although we get farther, we eventually fail with the error:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">ssh<span style="color: #66cc66;">:</span> connect to host ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com port <span style="color: #cc66cc;">22</span><span style="color: #66cc66;">:</span> Operation timed out</pre></div></div>

<p>Drat. Now what? After a little digging it&#8217;s determined that the problem is that we have not allowed the SSH protocol through the built in firewall associated with our application. This is fixed by navigating from within the EC Dashboard to &#8216;Security Groups -> default group&#8217; and adding the SSH protocol  to the table of connection methods.  Let&#8217;s try our deployment again.</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING<span style="color: #66cc66;">:</span> UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/don/DevelopmentWork/blogtwodo/etc/blogtwodo.pem' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.</pre></div></div>

<p>Sigh. OK. Trying again after <em>chmod</em>&#8216;ing the PEM file to 400 (<em>chmod 400 blogtwodo.pem</em>). </p>
<p>After <em><strong>several</strong></em> minutes (and I do mean several.. deployment took close to 10 minutes) this time we get:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">...
...
Location<span style="color: #66cc66;">:</span> http<span style="color: #66cc66;">:</span>//localhost/blogtwodo/ <span style="color: #66cc66;">&#91;</span>following<span style="color: #66cc66;">&#93;</span>
--<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">34</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">55</span>--  http<span style="color: #66cc66;">:</span>//localhost/blogtwodo/
Connecting to localhost|127.0.0.1|<span style="color: #66cc66;">:</span>80... connected.
HTTP request sent, awaiting response... <span style="color: #cc66cc;">404</span> /blogtwodo/
<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">34</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">55</span> ERROR <span style="color: #cc66cc;">404</span><span style="color: #66cc66;">:</span> /blogtwodo/.
&nbsp;
Finished deploying cluster</pre></div></div>

<p>Hmm. The ERROR 404 does not look good, but it does look like the application <em>technically</em> deployed.  A check on the EC2 console confirms that we have a single running instance, and clicking on it drills down to a panel that shows us the public DNS address we can use to test it out with a browser (running <em>grails cloud-tools-describe</em> gets us the same information from the command line.) When I visit the base address I get a generic Apache test page, which is encouraging:<br />
<a href="http://alterlabs.com/wp-content/uploads/2009/09/screen-capture.png"><img src="http://alterlabs.com/wp-content/uploads/2009/09/screen-capture-300x265.png" alt="apache2 testpage" title="apache2 testpage" width="300" height="265" class="alignnone size-medium wp-image-548" /></a></p>
<p>But, sure enough, I am greeted with a 404 error when I try to hit our applications URL with a browser.</p>
<p>So now what?  Well, when in doubt, go for the log files.  We can ssh directly into our running instance using our PEM file for authentication:</p>
<blockquote><p><em>ssh -i etc/blogtwodo.pem root@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com</em></p></blockquote>
<p>A bit of poking around/exploring our VPS leads me to a promising log file: <code>/var/log/tomcat5/catalina.out</code> with a suspicious stacktrace:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">...
java.lang.NoClassDefFoundError<span style="color: #66cc66;">:</span> net.chrisrichardson.ec2deployer.cluster.ClusterSpec
        at Config$_run_closure3.class$<span style="color: #66cc66;">&#40;</span>Config.groovy<span style="color: #66cc66;">&#41;</span>
        at Config$_run_closure3.$get$$class$net$chrisrichardson$ec2deployer$cluster$ClusterSpec<span style="color: #66cc66;">&#40;</span>Config.groovy<span style="color: #66cc66;">&#41;</span>
        at Config$_run_closure3.doCall<span style="color: #66cc66;">&#40;</span>Config.groovy<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">87</span><span style="color: #66cc66;">&#41;</span>
        at Config$_run_closure3.doCall<span style="color: #66cc66;">&#40;</span>Config.groovy<span style="color: #66cc66;">&#41;</span>
        at Config.run<span style="color: #66cc66;">&#40;</span>Config.groovy<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">76</span><span style="color: #66cc66;">&#41;</span>
...</pre></div></div>

<p>It would seem that the <em>CloudTools</em> jars don&#8217;t appear to be packaged into our deployment war file. After a bit of investigation, this problem turns out to be another issue caused by behavior changes to Grails v1.1.1&#8211; notably in the management of plugins. The <em>CloudTools</em> plugin expects to find stuff located local to the grails project directory and the new Grails v1.1.1 paradigm moves all that stuff to centralized ~/.grails (on a Mac anyway) location.  My hack to get things working involved creating a symbolic link so that <em>CloudTools</em> would deploy all the necessary bits (for all our other plugins as well):</p>
<blockquote><p>
<em>ln -s ~/.grails/1.1.1/projects/blogtwodo/plugins  ./plugins</em>
</p></blockquote>
<div class="strongpoint">
<strong>&iexcl;IMPORTANTE!</strong> It&#8217;s important to note that often times a failed deployment will still manage to start a new AMI instance on your behalf, which means you will billed $0.10 per/hour for this instances uptime, even if you never do anything with it. After every deployment attempt (successful or unsuccessful) I recommend checking the number of running instances in the EC2 console and terminating any that were accidents.
</div>
<p>OK. Surely that must be the last step.  After deploying once again, we again get the 404 error. Now what?  Well checking the logfile again reveals this:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">org.springframework.jdbc.CannotGetJdbcConnectionException<span style="color: #66cc66;">:</span> Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException<span style="color: #66cc66;">:</span> Cannot create PoolableConnectionFactory <span style="color: #66cc66;">&#40;</span>Access denied for user 'twodouser'@'localhost' <span style="color: #66cc66;">&#40;</span>using password<span style="color: #66cc66;">:</span> YES<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>I don&#8217;t doubt that there are better solutuions, but simply I punted and simply forcibly granted our &#8216;twoduser&#8217; access to the database via the <em>mysql</em> command line:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is <span style="color: #cc66cc;">6</span> to server version<span style="color: #66cc66;">:</span> 5.0.22-log
&nbsp;
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
&nbsp;
mysql&gt; use blogtwodo
Database changed
mysql&gt; GRANT USAGE ON *.* TO 'twodouser'@'localhost' IDENTIFIED BY 'password';
Query OK, <span style="color: #cc66cc;">0</span> rows affected <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.00</span> sec<span style="color: #66cc66;">&#41;</span>
&nbsp;
mysql&gt; GRANT ALL PRIVILEGES ON `blogtwodo`.* TO 'blogtwodo'@'localhost' WITH GRANT OPTION;
Query OK, <span style="color: #cc66cc;">0</span> rows affected <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.00</span> sec<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This time we want to make sure that we redeploy the application to the <strong>same</strong> AMI where we just made our database changes, so we deploy the app using the <em>cloud-tools-redeploy</em> gant target:</p>
<blockquote><p><em>grails cloud-tools-redeploy</em></p></blockquote>
<p>At last we get something that appears to be a clean deployment:</p>

<div class="wp_syntax"><div class="code"><pre class="robots" style="font-family:monospace;">Connecting to localhost|127.0.0.1|<span style="color: #66cc66;">:</span>8080... connected.
HTTP request sent, awaiting response... <span style="color: #cc66cc;">302</span> Moved Temporarily
Location<span style="color: #66cc66;">:</span> http<span style="color: #66cc66;">:</span>//localhost<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">8080</span>/blogtwodo/ <span style="color: #66cc66;">&#91;</span>following<span style="color: #66cc66;">&#93;</span>
--<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">48</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">48</span>--  http<span style="color: #66cc66;">:</span>//localhost<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">8080</span>/blogtwodo/
Connecting to localhost|127.0.0.1|<span style="color: #66cc66;">:</span>8080... connected.
HTTP request sent, awaiting response... <span style="color: #cc66cc;">302</span> Moved Temporarily
Location<span style="color: #66cc66;">:</span> http<span style="color: #66cc66;">:</span>//localhost<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">8080</span>/blogtwodo/public <span style="color: #66cc66;">&#91;</span>following<span style="color: #66cc66;">&#93;</span>
--<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">48</span><span style="color: #66cc66;">:</span><span style="color: #cc66cc;">49</span>--  http<span style="color: #66cc66;">:</span>//localhost<span style="color: #66cc66;">:</span><span style="color: #cc66cc;">8080</span>/blogtwodo/public
Connecting to localhost|127.0.0.1|<span style="color: #66cc66;">:</span>8080... connected.
HTTP request sent, awaiting response... <span style="color: #cc66cc;">200</span> OK
Length<span style="color: #66cc66;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#91;</span>text/html<span style="color: #66cc66;">&#93;</span>
<span style="color: #cc66cc;">200</span> OK
&nbsp;
Finished redeploying cluster</pre></div></div>

<p>Pointing the browser at the site confirms it as working:<br />
<div id="attachment_569" class="wp-caption alignnone" style="width: 310px"><a href="http://alterlabs.com/wp-content/uploads/2009/09/screen-capture-11.png"><img src="http://alterlabs.com/wp-content/uploads/2009/09/screen-capture-11-300x183.png" alt="click to enlarge" title="ec2-working" width="300" height="183" class="size-medium wp-image-569" /></a><p class="wp-caption-text">click to enlarge</p></div></p>
<p><strong>Awesome</strong>.</p>
<h3>Conclusion and Wrapup</h3>
<p> All told the above took about 2 days (16 hours) to get working. Our total number of hours spent prior to this was about 30 hours, which brings our total to ~46 hours&#8230; just over our 40 hour goal. Still not too bad IMO. Let&#8217;s survey the pros and cons about the approach we used today:</p>
<h3>Pros:</h3>
<ul>
<li>Integration with EC2 is largely transparent to your underlying Grails application&#8211; once you get everything configured correctly that is&#8230; after which deployment is a snap</li>
<li>This transparency is <strong>huge</strong>. I did <em>nothing</em>, repeat <strong>nothing</strong>, to alter the underlying application for suitability with EC2. This is <strong>NOT</strong> the case with Google&#8217;s AppEngine, as will be shown in the next post in this series.</li>
<li>I don&#8217;t doubt that using the CloudFoundry management console makes deployment that much easier, without the need of a plugin. I plan to play with this more later, so expect a blog post on this as well.
</li>
</ul>
<h3>Cons:</h3>
<ul>
<li>It&#8217;s not free. We deployed the twodo application in an absolutely bare bones configuration&#8211; A single AMI which costs US$0.10 per/hour &#8211;> US$2.40 per/day &#8211;> ~US$72 per/month. While not catastrophically expensive, if you don&#8217;t need the ability to infinitely scale on a moments notice, you can certainly find cheaper hosting options.</li>
<li>We currently have no persistent storage configured. Yes, we have a MySql instance running, but for all practical purposes it might as well be an in memory database. If the AMI ever goes away, our DB is slicked as well. A &#8216;real&#8217; Cloud Computing solution would require the use of something like <a href="http://aws.amazon.com/ebs/">Amazon&#8217;s Elastic Block Storage Service (EBS)</a> ( which is also not free)</li>
<li>While it was not a _ton_ of work, it did take some sleuthing to get things finally working. I am assuming that this plugin is likely to no longer be actively supported, as (presumably) the CloudFoundry system effectively replaces it. Not a con exactly, but I think I would investigate what CloudFoundry has to offer before choosing this plugin as my definitive approach to getting an app into the Cloud.</li>
</ul>
<p>That&#8217;s it for now. The next post in the series will document the deploying our application to Google&#8217;s AppEngine, so check back often/subscribe!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/amazon+ec2" rel="tag"> amazon ec2</a>, <a href="http://technorati.com/tag/cloud+computing" rel="tag"> cloud computing</a>, <a href="http://technorati.com/tag/grails" rel="tag"> grails</a>, <a href="http://technorati.com/tag/groovy" rel="tag"> groovy</a>, <a href="http://technorati.com/tag/java" rel="tag"> java</a>, <a href="http://technorati.com/tag/software+development" rel="tag"> software development</a></p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/uncategorized/grails-and-cloud-computing-part-1-amazon-ec/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Speaking @ DC Area PMI Luncheon Group</title>
		<link>http://alterlabs.com/uncategorized/speaking-dc-area-pmi-luncheon-group/</link>
		<comments>http://alterlabs.com/uncategorized/speaking-dc-area-pmi-luncheon-group/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 21:17:30 +0000</pubDate>
		<dc:creator>don</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alterlabs.com/uncategorized/speaking-dc-area-pmi-luncheon-group/</guid>
		<description><![CDATA[On Monday August 17th, Sunjay Pandey will be speaking at the Project Management Institute’s DC Area Luncheon Group .  Sunjay will be presenting a topic entitled Project Plan Ninja which discusses how to manage Rapid Business Requirements generation on a Rapid Application Development project. Sunjay will be presenting proven techniques that can take your [...]]]></description>
			<content:encoded><![CDATA[<p>On Monday August 17th, Sunjay Pandey will be speaking at the <a href="http://www.pmiwdc.org/2009-08-M2D2" target="_blank" title="DC Luncheon Group">Project Management Institute’s DC Area Luncheon Group</a> .  Sunjay will be presenting a topic entitled <a href="http://at.alterthought.com/project-plan-ninja" title="Project Plan Ninja">Project Plan Ninja</a> which discusses how to manage Rapid Business Requirements generation on a Rapid Application Development project. Sunjay will be presenting proven techniques that can take your team from vision to requirements in hours, not weeks. This event is free of charge, however advanced <a href="http://www.pmi-ssc.org/m2d2/registration.shtml">registration</a> is required. We look forward to seeing you there!</p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/uncategorized/speaking-dc-area-pmi-luncheon-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking @ Tyson&#8217;s Corner PMI Luncheon Group</title>
		<link>http://alterlabs.com/uncategorized/speaking-tysons-corner-pmi-luncheon-group/</link>
		<comments>http://alterlabs.com/uncategorized/speaking-tysons-corner-pmi-luncheon-group/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 18:15:55 +0000</pubDate>
		<dc:creator>sunjay</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alterlabs.com/uncategorized/speaking-tysons-corner-pmi-luncheon-group/</guid>
		<description><![CDATA[On Tuesday  March 24th, Sunjay Pandey will be speaking at the Project Management Institute&#8217;s Tyson&#8217;s Corner Area Luncheon Group .  Sunjay will be reprising a topic entitled The Switching Gears Factor which describes portions of ALTERthought&#8217;s IT Governance approaches &#8211; particularly estimation and budgeting.  In this session, Sunjay will discuss how the multi-tasking arising from [...]]]></description>
			<content:encoded><![CDATA[<p>On Tuesday  March 24th, Sunjay Pandey will be speaking at the <a title="Tyson's Corner Luncheon Group" href="http://www.pmiwdc.org/2009-03-Tysons" /><a target="_blank" title="Tyson's Corner Luncheon Group" href="http://www.pmiwdc.org/2009-03-Tysons">Project Management Institute&#8217;s Tyson&#8217;s Corner Area Luncheon Group</a> .  Sunjay will be reprising a topic entitled <a href="http://alterlabs.com/general/articles/the-switching-gears-factor/">The Switching Gears Factor</a> which describes portions of <a href="http://alterlabs.com/wp-admin/alterthought.com">ALTERthought&#8217;s</a> IT Governance approaches &#8211; particularly estimation and budgeting.  In this session, Sunjay will discuss how the multi-tasking arising from multi-project assignments can impact IT projects. He will also discuss how it can  be accounted for and how to manage this impact. Registration is available <a target="_blank" href="https://www.signup4.net/public/ap.aspx?EID=20061395E&#038;OID=130">on-line</a>. We look forward to seeing you there.</p>
   ]]></content:encoded>
			<wfw:commentRss>http://alterlabs.com/uncategorized/speaking-tysons-corner-pmi-luncheon-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
