<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-292934739708456627</id><updated>2011-07-31T01:51:17.103+03:00</updated><title type='text'>The Creation of JavaEdge 2008 Cloud Session Demo</title><subtitle type='html'>My name is Baruch Sadogursky, and I am going to present the "Java in the Cloud" session at JavaEdge 2008.
This blog describes the creation of the session's demo, which will be the heart of the presentation.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-1129014887422445028</id><published>2010-10-31T17:44:00.000+02:00</published><updated>2010-10-31T17:45:01.279+02:00</updated><title type='text'>My _real_ blog</title><content type='html'>blog.sadogursky.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-1129014887422445028?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/1129014887422445028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=1129014887422445028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1129014887422445028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1129014887422445028'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2010/10/my-real-blog.html' title='My _real_ blog'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-1691641781617985632</id><published>2008-12-24T21:48:00.003+02:00</published><updated>2008-12-24T21:52:53.525+02:00</updated><title type='text'>Featured @ SlideShare</title><content type='html'>Yo! The presentation was selected as "featured" on SlideShare and now it appears on the main screen!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_QpiM9uPT4u8/SVKSetKYR4I/AAAAAAAAAAM/SNuBKwGKRtA/s1600-h/slideshare+main.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: left; cursor: pointer; width: 400px; height: 342px;" src="http://3.bp.blogspot.com/_QpiM9uPT4u8/SVKSetKYR4I/AAAAAAAAAAM/SNuBKwGKRtA/s400/slideshare+main.png" alt="" id="BLOGGER_PHOTO_ID_5283446369075873666" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-1691641781617985632?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/1691641781617985632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=1691641781617985632' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1691641781617985632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1691641781617985632'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/12/featured-slideshare.html' title='Featured @ SlideShare'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_QpiM9uPT4u8/SVKSetKYR4I/AAAAAAAAAAM/SNuBKwGKRtA/s72-c/slideshare+main.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-4289478869507409687</id><published>2008-12-20T15:58:00.001+02:00</published><updated>2008-12-20T15:58:35.422+02:00</updated><title type='text'>The Presentation</title><content type='html'>&lt;div style="width:425px;text-align:left" id="__ss_861493"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/jbaruch/Java-For-The-Cloud?type=powerpoint" title="Java For The Cloud Presentation @ AlphaCSP&amp;#39;s JavaEdge 2008"&gt;Java For The Cloud Presentation @ AlphaCSP&amp;#39;s JavaEdge 2008&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=JavaForTheCloud-122977559014-phpapp01&amp;rel=0&amp;stripped_title=Java-For-The-Cloud" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=JavaForTheCloud-122977559014-phpapp01&amp;rel=0&amp;stripped_title=Java-For-The-Cloud" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View SlideShare &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/jbaruch/Java-For-The-Cloud?type=powerpoint" title="View Java For The Cloud Presentation @ AlphaCSP&amp;#39;s JavaEdge 2008 on SlideShare"&gt;presentation&lt;/a&gt; or &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint"&gt;Upload&lt;/a&gt; your own. (tags: &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/lifeguard"&gt;lifeguard&lt;/a&gt; &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/gae"&gt;gae&lt;/a&gt;)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-4289478869507409687?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/4289478869507409687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=4289478869507409687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/4289478869507409687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/4289478869507409687'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/12/presentation_20.html' title='The Presentation'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-3016930386008931537</id><published>2008-12-07T13:37:00.001+02:00</published><updated>2008-12-07T13:42:24.134+02:00</updated><title type='text'>The Run - Screencast</title><content type='html'>&lt;object width="640" height="505"&gt;&lt;param name="movie" value="http://www.youtube.com/v/zSuRKd21hW8&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/zSuRKd21hW8&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-3016930386008931537?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/3016930386008931537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=3016930386008931537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/3016930386008931537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/3016930386008931537'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/12/run-screencast.html' title='The Run - Screencast'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-8369403178560904296</id><published>2008-10-08T19:57:00.005+02:00</published><updated>2008-10-15T11:21:35.583+02:00</updated><title type='text'>The Run</title><content type='html'>Let's roll!&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Start one instance of Server AMI&lt;/li&gt;&lt;li&gt;The Terracotta server starts automatically&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Associate its instance ID with the Elastic IP, referred in tc-config.xml in the Client AMI&lt;/li&gt;&lt;li&gt;Start one instance Client AMI&lt;/li&gt;&lt;li&gt;The Shared Queue example runs&lt;/li&gt;&lt;li&gt;Copy the client's public DNS and access the UI in browser (http://the-client-public-dns:1990/webapp/)&lt;/li&gt;&lt;li&gt;Add less than 100 jobs to the queue&lt;/li&gt;&lt;li&gt;All the jobs processed by the existing single client&lt;/li&gt;&lt;li&gt;Add more than 100 jobs to the queue&lt;/li&gt;&lt;li&gt;See in the ElasticFox how another client instance is getting up and running&lt;/li&gt;&lt;li&gt;Check the UI to see how two clients now handling the jobs!&lt;/li&gt;&lt;/ul&gt;That's all :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-8369403178560904296?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/8369403178560904296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=8369403178560904296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/8369403178560904296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/8369403178560904296'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/10/run.html' title='The Run'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-8725844497257596927</id><published>2008-10-08T19:49:00.003+02:00</published><updated>2008-10-08T19:56:54.467+02:00</updated><title type='text'>Stage 4 - The Client AMI</title><content type='html'>The last stage - create the client AMI. Since I already had Server AMI with JDK and Terracotta installed, I only needed to complete couple of other things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I instansiated server&lt;/li&gt;&lt;li&gt;Remotely copied the src and lib directories of the demo (the new code and the new dependencies), the run.sh (with the new classpath) and the build.xml (with the new compile classpath)&lt;/li&gt;&lt;li&gt;Logged in to the server and run build.&lt;/li&gt;&lt;li&gt;Added run.sh to the init.d (for the autostart of the client once the machine is up)&lt;/li&gt;&lt;li&gt;Created AMI, uploaded it to S3 and registered with EC2 (see &lt;a href="http://javaedge2008-cloud-demo.blogspot.com/2008/09/stage-2-create-server-ami.html"&gt;Stage 2&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;Added ports 1990-2000 (10 clients) to the whitelist of my custom "Terracotta" security group (already done in &lt;a href="http://javaedge2008-cloud-demo.blogspot.com/2008/09/stage-3-code.html"&gt;Stage 3&lt;/a&gt;).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-8725844497257596927?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/8725844497257596927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=8725844497257596927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/8725844497257596927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/8725844497257596927'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/10/stage-4-client-ami.html' title='Stage 4 - The Client AMI'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-3885623904751389345</id><published>2008-09-30T15:48:00.007+03:00</published><updated>2008-12-04T16:38:42.019+02:00</updated><title type='text'>Stage 3 - The Code</title><content type='html'>Now it's time to add the auto-start code.&lt;br /&gt;I tried to change the existing code as little as possible (that's the idea - keep the changes small).&lt;br /&gt;&lt;a href="http://liqweed.blogspot.com/"&gt;Ophir&lt;/a&gt; pointed me to great EC2 API for Java - &lt;a href="http://code.google.com/p/typica/"&gt;Typica&lt;/a&gt;.&lt;br /&gt;It has a little dependencies, so I added them to the demo, and changed the build appropriately.&lt;br /&gt;The most simple and less intrusive addition I can think of is listener on the "doAddWork" operation in HttpHandler.&lt;br /&gt;As it being invoked, the only new class, Ec2Instantiator is notified. There I can encapsulate all the EC2 work without intruding the example.&lt;br /&gt;&lt;br /&gt;So, what the code does?&lt;br /&gt;&lt;br /&gt;First of all, it checks if new server is needed - if after the addition more than 100 jobs will be in the queue, fire new server. It's stupid check, but very simple, isn't it?&lt;br /&gt;If that's the case, load different EC2 properties from properties file. Those properties include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;AWS Access Id and Secret Key to perform any operations&lt;/li&gt;&lt;li&gt;Owner Id to find my images&lt;/li&gt;&lt;li&gt;Client Image Location to distinguish it from Server Image&lt;/li&gt;&lt;li&gt;Key Name to start the server with it&lt;/li&gt;&lt;li&gt;Custom Security Group additional security group (in addition to default) to run the server with it. In my case it's the same Terracotta security group, which opens port 9510 for the server, and ports 1190-2000 for 10 clients&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Once the properties are loaded, the code gets all images by owner. From those, it picks one, which matches client image location, and launches one instance of it.&lt;br /&gt;&lt;br /&gt;That's it! As simple as it gets! Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span class="s0"&gt;@SuppressWarnings({&lt;/span&gt;&lt;span class="s1"&gt;"UseOfSystemOutOrSystemErr"&lt;/span&gt;&lt;span class="s0"&gt;, &lt;/span&gt;&lt;span class="s1"&gt;"CallToPrintStackTrace"&lt;/span&gt;&lt;span class="s0"&gt;})&lt;br /&gt;&lt;br /&gt;&lt;a name="l15"&gt;&lt;span class="ln"&gt;15   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s2"&gt;public class &lt;/span&gt;&lt;span class="s0"&gt;Ec2Instantiator &lt;/span&gt;&lt;span class="s2"&gt;implements &lt;/span&gt;&lt;span class="s0"&gt;QueueGrowListener {&lt;br /&gt;&lt;a name="l16"&gt;&lt;span class="ln"&gt;16   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l17"&gt;&lt;span class="ln"&gt;17   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String accessId;&lt;br /&gt;&lt;a name="l18"&gt;&lt;span class="ln"&gt;18   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String accessKey;&lt;br /&gt;&lt;a name="l19"&gt;&lt;span class="ln"&gt;19   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String ownerId;&lt;br /&gt;&lt;br /&gt;&lt;a name="l20"&gt;&lt;span class="ln"&gt;20   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String clientImageLocation;&lt;br /&gt;&lt;a name="l21"&gt;&lt;span class="ln"&gt;21   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String keyName;&lt;br /&gt;&lt;a name="l22"&gt;&lt;span class="ln"&gt;22   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private &lt;/span&gt;&lt;span class="s0"&gt;String customSecurityGroup;&lt;br /&gt;&lt;a name="l23"&gt;&lt;span class="ln"&gt;23   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;private int &lt;/span&gt;&lt;span class="s0"&gt;triggerSize;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l24"&gt;&lt;span class="ln"&gt;24   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l25"&gt;&lt;span class="ln"&gt;25   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;public &lt;/span&gt;&lt;span class="s0"&gt;Ec2Instantiator(Properties appProps) {&lt;br /&gt;&lt;a name="l26"&gt;&lt;span class="ln"&gt;26   &lt;/span&gt;&lt;/a&gt;        &lt;/span&gt;&lt;span class="s2"&gt;this&lt;/span&gt;&lt;span class="s0"&gt;.accessId = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.accessId"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l27"&gt;&lt;span class="ln"&gt;27   &lt;/span&gt;&lt;/a&gt;        &lt;/span&gt;&lt;span class="s2"&gt;this&lt;/span&gt;&lt;span class="s0"&gt;.accessKey = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.secretKey"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;a name="l28"&gt;&lt;span class="ln"&gt;28   &lt;/span&gt;&lt;/a&gt;        ownerId = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.ownerId"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l29"&gt;&lt;span class="ln"&gt;29   &lt;/span&gt;&lt;/a&gt;        clientImageLocation = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.clientImageLocation"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l30"&gt;&lt;span class="ln"&gt;30   &lt;/span&gt;&lt;/a&gt;        keyName = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.keyName"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l31"&gt;&lt;span class="ln"&gt;31   &lt;/span&gt;&lt;/a&gt;        customSecurityGroup = appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"aws.customSecurityGroup"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;a name="l32"&gt;&lt;span class="ln"&gt;32   &lt;/span&gt;&lt;/a&gt;        triggerSize = Integer.parseInt(appProps.getProperty(&lt;/span&gt;&lt;span class="s1"&gt;"queue.triggerSize"&lt;/span&gt;&lt;span class="s0"&gt;));&lt;br /&gt;&lt;a name="l33"&gt;&lt;span class="ln"&gt;33   &lt;/span&gt;&lt;/a&gt;    }&lt;hr /&gt;&lt;br /&gt;&lt;a name="l34"&gt;&lt;span class="ln"&gt;34   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l35"&gt;&lt;span class="ln"&gt;35   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s2"&gt;public void &lt;/span&gt;&lt;span class="s0"&gt;queueGrown(&lt;/span&gt;&lt;span class="s2"&gt;int &lt;/span&gt;&lt;span class="s0"&gt;oldSize, &lt;/span&gt;&lt;span class="s2"&gt;int &lt;/span&gt;&lt;span class="s0"&gt;newSize) {&lt;br /&gt;&lt;br /&gt;&lt;a name="l36"&gt;&lt;span class="ln"&gt;36   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l37"&gt;&lt;span class="ln"&gt;37   &lt;/span&gt;&lt;/a&gt;        &lt;/span&gt;&lt;span class="s3"&gt;//All this happnes only if too many jobs added to the queue&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l38"&gt;&lt;span class="ln"&gt;38   &lt;/span&gt;&lt;/a&gt;        &lt;/span&gt;&lt;span class="s2"&gt;if &lt;/span&gt;&lt;span class="s0"&gt;(newSize &amp;gt; triggerSize) {&lt;br /&gt;&lt;a name="l39"&gt;&lt;span class="ln"&gt;39   &lt;/span&gt;&lt;/a&gt;            System.out.println(&lt;/span&gt;&lt;span class="s1"&gt;"Queue overloaded! Will fire up another client to help"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;a name="l40"&gt;&lt;span class="ln"&gt;40   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l41"&gt;&lt;span class="ln"&gt;41   &lt;/span&gt;&lt;/a&gt;            &lt;/span&gt;&lt;span class="s3"&gt;//Start new instance asyncronicaly&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l42"&gt;&lt;span class="ln"&gt;42   &lt;/span&gt;&lt;/a&gt;            &lt;/span&gt;&lt;span class="s2"&gt;new &lt;/span&gt;&lt;span class="s0"&gt;Thread(&lt;/span&gt;&lt;span class="s2"&gt;new &lt;/span&gt;&lt;span class="s0"&gt;Runnable() {&lt;br /&gt;&lt;a name="l43"&gt;&lt;span class="ln"&gt;43   &lt;/span&gt;&lt;/a&gt;                &lt;/span&gt;&lt;span class="s2"&gt;public void &lt;/span&gt;&lt;span class="s0"&gt;run() {&lt;br /&gt;&lt;a name="l44"&gt;&lt;span class="ln"&gt;44   &lt;/span&gt;&lt;/a&gt;                    &lt;/span&gt;&lt;span class="s2"&gt;try &lt;/span&gt;&lt;span class="s0"&gt;{&lt;br /&gt;&lt;br /&gt;&lt;a name="l45"&gt;&lt;span class="ln"&gt;45   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l46"&gt;&lt;span class="ln"&gt;46   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//connect to EC2&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l47"&gt;&lt;span class="ln"&gt;47   &lt;/span&gt;&lt;/a&gt;                        Jec2 ec2 = &lt;/span&gt;&lt;span class="s2"&gt;new &lt;/span&gt;&lt;span class="s0"&gt;Jec2(accessId, accessKey);&lt;br /&gt;&lt;a name="l48"&gt;&lt;span class="ln"&gt;48   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l49"&gt;&lt;span class="ln"&gt;49   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//get all my images&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l50"&gt;&lt;span class="ln"&gt;50   &lt;/span&gt;&lt;/a&gt;                        List&amp;lt;ImageDescription&amp;gt; myImages = ec2.describeImagesByOwner(asList(ownerId));&lt;br /&gt;&lt;a name="l51"&gt;&lt;span class="ln"&gt;51   &lt;/span&gt;&lt;/a&gt;                        ImageDescription clientImage = &lt;/span&gt;&lt;span class="s2"&gt;null&lt;/span&gt;&lt;span class="s0"&gt;;&lt;br /&gt;&lt;a name="l52"&gt;&lt;span class="ln"&gt;52   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s2"&gt;for &lt;/span&gt;&lt;span class="s0"&gt;(ImageDescription image : myImages) {&lt;br /&gt;&lt;a name="l53"&gt;&lt;span class="ln"&gt;53   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l54"&gt;&lt;span class="ln"&gt;54   &lt;/span&gt;&lt;/a&gt;                            &lt;/span&gt;&lt;span class="s3"&gt;//find the Terracotta client one&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l55"&gt;&lt;span class="ln"&gt;55   &lt;/span&gt;&lt;/a&gt;                            &lt;/span&gt;&lt;span class="s2"&gt;if &lt;/span&gt;&lt;span class="s0"&gt;(image.getImageLocation().equals(clientImageLocation)) {&lt;br /&gt;&lt;a name="l56"&gt;&lt;span class="ln"&gt;56   &lt;/span&gt;&lt;/a&gt;                                clientImage = image;&lt;br /&gt;&lt;a name="l57"&gt;&lt;span class="ln"&gt;57   &lt;/span&gt;&lt;/a&gt;                            }&lt;br /&gt;&lt;a name="l58"&gt;&lt;span class="ln"&gt;58   &lt;/span&gt;&lt;/a&gt;                        }&lt;br /&gt;&lt;br /&gt;&lt;a name="l59"&gt;&lt;span class="ln"&gt;59   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s2"&gt;if &lt;/span&gt;&lt;span class="s0"&gt;(clientImage == &lt;/span&gt;&lt;span class="s2"&gt;null&lt;/span&gt;&lt;span class="s0"&gt;) {&lt;br /&gt;&lt;a name="l60"&gt;&lt;span class="ln"&gt;60   &lt;/span&gt;&lt;/a&gt;                            &lt;/span&gt;&lt;span class="s2"&gt;throw new &lt;/span&gt;&lt;span class="s0"&gt;IllegalStateException(&lt;/span&gt;&lt;span class="s1"&gt;"Can't find image manifest in " &lt;/span&gt;&lt;span class="s0"&gt;+ clientImageLocation);&lt;br /&gt;&lt;a name="l61"&gt;&lt;span class="ln"&gt;61   &lt;/span&gt;&lt;/a&gt;                        }&lt;br /&gt;&lt;a name="l62"&gt;&lt;span class="ln"&gt;62   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l63"&gt;&lt;span class="ln"&gt;63   &lt;/span&gt;&lt;/a&gt;                        System.out.println(&lt;/span&gt;&lt;span class="s1"&gt;"Found JavaEdge Client image: "&lt;/span&gt;&lt;span class="s0"&gt;+clientImage.getImageId());&lt;br /&gt;&lt;a name="l64"&gt;&lt;span class="ln"&gt;64   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l65"&gt;&lt;span class="ln"&gt;65   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//launch configuration - which machine, which security groups&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l66"&gt;&lt;span class="ln"&gt;66   &lt;/span&gt;&lt;/a&gt;                        LaunchConfiguration launchConfiguration = &lt;/span&gt;&lt;span class="s2"&gt;new &lt;/span&gt;&lt;span class="s0"&gt;LaunchConfiguration(clientImage.getImageId());&lt;br /&gt;&lt;a name="l67"&gt;&lt;span class="ln"&gt;67   &lt;/span&gt;&lt;/a&gt;                        launchConfiguration.setKeyName(keyName);&lt;br /&gt;&lt;br /&gt;&lt;a name="l68"&gt;&lt;span class="ln"&gt;68   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l69"&gt;&lt;span class="ln"&gt;69   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//small instance&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l70"&gt;&lt;span class="ln"&gt;70   &lt;/span&gt;&lt;/a&gt;                        launchConfiguration.setInstanceType(InstanceType.DEFAULT);&lt;br /&gt;&lt;a name="l71"&gt;&lt;span class="ln"&gt;71   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l72"&gt;&lt;span class="ln"&gt;72   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//both default and terracotta security groups&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l73"&gt;&lt;span class="ln"&gt;73   &lt;/span&gt;&lt;/a&gt;                        launchConfiguration.setSecurityGroup(asList(&lt;/span&gt;&lt;span class="s1"&gt;"default"&lt;/span&gt;&lt;span class="s0"&gt;, customSecurityGroup));&lt;br /&gt;&lt;br /&gt;&lt;a name="l74"&gt;&lt;span class="ln"&gt;74   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l75"&gt;&lt;span class="ln"&gt;75   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//RUN!&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l76"&gt;&lt;span class="ln"&gt;76   &lt;/span&gt;&lt;/a&gt;                        System.out.println(&lt;/span&gt;&lt;span class="s1"&gt;"Starting instance."&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l77"&gt;&lt;span class="ln"&gt;77   &lt;/span&gt;&lt;/a&gt;                        ReservationDescription reservationDescription = ec2.runInstances(launchConfiguration);&lt;br /&gt;&lt;a name="l78"&gt;&lt;span class="ln"&gt;78   &lt;/span&gt;&lt;/a&gt;                        ReservationDescription.Instance instance = reservationDescription.getInstances().get(&lt;/span&gt;&lt;span class="s4"&gt;0&lt;/span&gt;&lt;span class="s0"&gt;);&lt;/span&gt;&lt;span class="s3"&gt;//i run one, so there is one&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l79"&gt;&lt;span class="ln"&gt;79   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a name="l80"&gt;&lt;span class="ln"&gt;80   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s3"&gt;//check the state&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l81"&gt;&lt;span class="ln"&gt;81   &lt;/span&gt;&lt;/a&gt;                        System.out.println(&lt;/span&gt;&lt;span class="s1"&gt;"Instance state: " &lt;/span&gt;&lt;span class="s0"&gt;+ instance.getState());&lt;br /&gt;&lt;a name="l82"&gt;&lt;span class="ln"&gt;82   &lt;/span&gt;&lt;/a&gt;                        &lt;/span&gt;&lt;span class="s2"&gt;while &lt;/span&gt;&lt;span class="s0"&gt;(!instance.isRunning()) {&lt;br /&gt;&lt;a name="l83"&gt;&lt;span class="ln"&gt;83   &lt;/span&gt;&lt;/a&gt;                                paintActivity();&lt;br /&gt;&lt;br /&gt;&lt;a name="l84"&gt;&lt;span class="ln"&gt;84   &lt;/span&gt;&lt;/a&gt;                                instance = ec2.describeInstances(asList(instance.getInstanceId())).get(&lt;/span&gt;&lt;span class="s4"&gt;0&lt;/span&gt;&lt;span class="s0"&gt;).getInstances().get(&lt;/span&gt;&lt;span class="s4"&gt;0&lt;/span&gt;&lt;span class="s0"&gt;);&lt;/span&gt;&lt;span class="s3"&gt;//refresh&lt;/span&gt;&lt;span class="s0"&gt;&lt;br /&gt;&lt;a name="l85"&gt;&lt;span class="ln"&gt;85   &lt;/span&gt;&lt;/a&gt;                        }&lt;br /&gt;&lt;a name="l86"&gt;&lt;span class="ln"&gt;86   &lt;/span&gt;&lt;/a&gt;                        System.out.println(&lt;/span&gt;&lt;span class="s1"&gt;"Instance is up. Check the UI to see the new client in action."&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;a name="l87"&gt;&lt;span class="ln"&gt;87   &lt;/span&gt;&lt;/a&gt;                    } &lt;/span&gt;&lt;span class="s2"&gt;catch &lt;/span&gt;&lt;span class="s0"&gt;(EC2Exception e) {&lt;br /&gt;&lt;a name="l88"&gt;&lt;span class="ln"&gt;88   &lt;/span&gt;&lt;/a&gt;                        System.err.println(&lt;/span&gt;&lt;span class="s1"&gt;"Error during client instance instantiation"&lt;/span&gt;&lt;span class="s0"&gt;);&lt;br /&gt;&lt;a name="l89"&gt;&lt;span class="ln"&gt;89   &lt;/span&gt;&lt;/a&gt;                        e.printStackTrace();&lt;br /&gt;&lt;a name="l90"&gt;&lt;span class="ln"&gt;90   &lt;/span&gt;&lt;/a&gt;                    }&lt;br /&gt;&lt;a name="l91"&gt;&lt;span class="ln"&gt;91   &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="l92"&gt;&lt;span class="ln"&gt;92   &lt;/span&gt;&lt;/a&gt;                }&lt;br /&gt;&lt;a name="l93"&gt;&lt;span class="ln"&gt;93   &lt;/span&gt;&lt;/a&gt;            }).start();&lt;br /&gt;&lt;a name="l94"&gt;&lt;span class="ln"&gt;94   &lt;/span&gt;&lt;/a&gt;        }&lt;br /&gt;&lt;a name="l95"&gt;&lt;span class="ln"&gt;95   &lt;/span&gt;&lt;/a&gt;    }&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-3885623904751389345?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/3885623904751389345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=3885623904751389345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/3885623904751389345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/3885623904751389345'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/09/stage-3-code.html' title='Stage 3 - The Code'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-1423125849541694860</id><published>2008-09-28T12:36:00.006+03:00</published><updated>2008-12-06T15:26:23.730+02:00</updated><title type='text'>Stage 2 - Create Server AMI</title><content type='html'>&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;OK&lt;/span&gt;, now to the real thing - create the Amazon Machine Images (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;AMIs&lt;/span&gt;&lt;/span&gt;) for the server and the client. I started with the server.&lt;br /&gt;Using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Elasticfox&lt;/span&gt;&lt;/span&gt; I choose one of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Ubuntu&lt;/span&gt;&lt;/span&gt; Hardy basic images, run it, logged in.&lt;br /&gt;Two things to install on the server machine:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Java&lt;/li&gt;&lt;li&gt;Terracotta server&lt;/li&gt;&lt;/ul&gt;Java is easy - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;apptitude&lt;/span&gt;&lt;/span&gt; install sun-java6-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;jdk&lt;/span&gt;&lt;/span&gt;, and this is it. Accept the EULA, export JAVA_HOME, done.&lt;br /&gt;&lt;br /&gt;Terracotta was more complicated. I didn't find &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;debian&lt;/span&gt;&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;distro&lt;/span&gt;&lt;/span&gt; for it, nor public download link on the site, so I &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;scp&lt;/span&gt;&lt;/span&gt;-ed the tar.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;gz&lt;/span&gt;&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;archive&lt;/span&gt; from my computer. Unzip it, and it runs!&lt;br /&gt;&lt;br /&gt;Next step was to create AMI from the current setup, upload it to Amazon S3 storage and to register it in EC2. Step-by-step instructions are &lt;a href="http://docs.amazonwebservices.com/AWSEC2/2008-05-05/GettingStartedGuide/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Time to check the server. Terracotta server runs by default on port 9510. I created new &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;permissions&lt;/span&gt; group in which this port is open (using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Elasticfox&lt;/span&gt;&lt;/span&gt;, of course), and next I chose my own (!) image from the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;available&lt;/span&gt; images, and booted an instance with two &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;permissions&lt;/span&gt; groups - default (for SSH etc.) and my custom one. &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;Hooray&lt;/span&gt;, it is already &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;preconfigured&lt;/span&gt;&lt;/span&gt; and has everything I need! The only thing I have to improve is to add the terracotta server &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;startup&lt;/span&gt;&lt;/span&gt; to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;init&lt;/span&gt;&lt;/span&gt;.d.&lt;br /&gt;&lt;br /&gt;Now, the problem arose. In the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;tc&lt;/span&gt;&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;config&lt;/span&gt;&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;xml&lt;/span&gt;&lt;/span&gt; file I have to specify the server's &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;IP&lt;/span&gt;&lt;/span&gt;, but the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;IP&lt;/span&gt;&lt;/span&gt; I get from EC2 changes every time I boot new instance.&lt;br /&gt;Elastic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;IP&lt;/span&gt;&lt;/span&gt; to the rescue! I can register &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;IPs&lt;/span&gt;&lt;/span&gt; for my AMI user, and assign them to running instances. This is exactly what I need. I registered elastic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;IP&lt;/span&gt;&lt;/span&gt; using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Elasticfox&lt;/span&gt;&lt;/span&gt;, and assigned it to my running server instance.&lt;br /&gt;&lt;br /&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;sharedqueue&lt;/span&gt;&lt;/span&gt; sample runs smoothly. I am sceptical, so I want to check if it really use the server on EC2. I checked the logs on the server, and it is! The server got connection from my local &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;IP&lt;/span&gt;&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;P.S. Useful links for EC2 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;config&lt;/span&gt; and run:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.amazonwebservices.com/AWSEC2/2008-05-05/GettingStartedGuide/"&gt;EC2 Getting Started Guide&lt;/a&gt; - command line utilities, most of their operations can be done in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;Elasticfox&lt;/span&gt;, but gives great picture of what's going on.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=bBajLxeKqoY"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;Firefox&lt;/span&gt; EC2 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;UI&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;screencast&lt;/span&gt;&lt;/a&gt; - shows old version of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;Elasticfox&lt;/span&gt; in action. The basics are the same, so it is useful.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-1423125849541694860?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/1423125849541694860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=1423125849541694860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1423125849541694860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/1423125849541694860'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/09/stage-2-create-server-ami.html' title='Stage 2 - Create Server AMI'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-5808617745340524909</id><published>2008-09-27T23:59:00.004+03:00</published><updated>2008-09-30T16:08:20.652+03:00</updated><title type='text'>Stage 1 - Download &amp; Run Terracotta</title><content type='html'>That's easy one (almost).&lt;br /&gt;I went to www.terracotta.com and followed the download links.&lt;br /&gt;Out of the blue I had a very stupid problem - I clicked on download link and... nothing happened. The server returned empty page.&lt;br /&gt;The link looks something like this - &lt;a href="http://www.terracotta.org/elqNow/elqRedir.htm?ref=http%3A%2F%2Fs3.amazonaws.com%3A80%2FTCreleases%2Fterracotta-generic-2.6.4.tar.gz%3FSignature%3Dkp0qhO7y9BHgKMsIhioUTXPWN18%253D%26Expires%3D1222556569%26AWSAccessKeyId%3D1ASD4K6SWEHW65J0HV82"&gt;http://www.terracotta.org/elqNow/elqRedir.htm?ref=http%3A%2F%2Fs3.amazonaws.com%3A80%2FTCreleases%2Fterracotta-generic-2.6.4.tar.gz%3FSignature%3Dkp0qhO7y9BHgKMsIhioUTXPWN18%253D%26Expires%3D1222556569%26AWSAccessKeyId%3D1ASD4K6SWEHW65J0HV82&lt;/a&gt;&lt;br /&gt;Unescaping it give me this one - &lt;a href="http://www.terracotta.org/elqNow/elqRedir.htm?ref=http://s3.amazonaws.com:80/TCreleases/terracotta-generic-2.6.4.tar.gz?Signature=kp0qhO7y9BHgKMsIhioUTXPWN18%3D&amp;amp;Expires=1222556569&amp;amp;AWSAccessKeyId=1ASD4K6SWEHW65J0HV82"&gt;http://www.terracotta.org/elqNow/elqRedir.htm?ref=http://s3.amazonaws.com:80/TCreleases/terracotta-generic-2.6.4.tar.gz?Signature=kp0qhO7y9BHgKMsIhioUTXPWN18%3D&amp;amp;Expires=1222556569&amp;amp;AWSAccessKeyId=1ASD4K6SWEHW65J0HV82&lt;/a&gt;&lt;br /&gt;So I took the s3 part only, and the download begun.&lt;br /&gt;&lt;br /&gt;I am really impressed with the shared queue example. It is simple and powerful, and give me all I need.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-5808617745340524909?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/5808617745340524909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=5808617745340524909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/5808617745340524909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/5808617745340524909'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/09/stage-1-download-and-run-terracotta.html' title='Stage 1 - Download &amp; Run Terracotta'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-292934739708456627.post-934237289251726264</id><published>2008-09-25T17:10:00.008+03:00</published><updated>2008-09-30T16:07:16.243+03:00</updated><title type='text'>The Idea</title><content type='html'>This is what I want to do:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install &lt;a href="http://www.terracotta.org/"&gt;Terracotta&lt;/a&gt; and the examples&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Customize &lt;a href="http://www.terracotta.org/confluence/display/howto/POJO+Quick+Start#POJOQuickStart-SharedWorkQueue"&gt;Shared Work queue&lt;/a&gt; example by adding a queue monitor, which will fire up new instances of Workers, once the queue is overloaded&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Prepare AMIs of Terracotta server and client&lt;/li&gt;&lt;li&gt;Upload them to Amazon&lt;br /&gt;&lt;/li&gt;&lt;li&gt;During the demo startup the server from IntelliJ plugin&lt;/li&gt;&lt;li&gt;Let the master startup workers programatically&lt;/li&gt;&lt;/ol&gt;Environment:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ubuntu 8.04&lt;/li&gt;&lt;li&gt;OpenJDK 6&lt;/li&gt;&lt;li&gt;IntelliJ IDEA&lt;/li&gt;&lt;li&gt;FireFox 3 with ElasticFox plugin&lt;/li&gt;&lt;/ul&gt;Let's roll!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/292934739708456627-934237289251726264?l=javaedge2008-cloud-demo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaedge2008-cloud-demo.blogspot.com/feeds/934237289251726264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=292934739708456627&amp;postID=934237289251726264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/934237289251726264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/292934739708456627/posts/default/934237289251726264'/><link rel='alternate' type='text/html' href='http://javaedge2008-cloud-demo.blogspot.com/2008/09/idea.html' title='The Idea'/><author><name>JBaruch</name><uri>http://www.blogger.com/profile/06211138673261757309</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_QpiM9uPT4u8/SWWudZg3lTI/AAAAAAAAAAY/P961XMYx3EA/S220/alphacsp.jpg'/></author><thr:total>0</thr:total></entry></feed>
