tag:blogger.com,1999:blog-8474871406958844140.post1491396008222473815..comments2023-12-26T12:46:48.683+00:00Comments on Tech Team Lead News: Setting up an Amazon AMI with Java and MySQL on EBS using the AWS Management ConsoleTechiehttp://www.blogger.com/profile/09242813498513889831noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8474871406958844140.post-66488234846040551672009-11-22T10:13:58.801+00:002009-11-22T10:13:58.801+00:00Update: note that Amazon RDS now offers easier rel...<b>Update</b>: note that <a href="http://aws.typepad.com/aws/2009/10/introducing-rds-the-amazon-relational-database-service-.html" rel="nofollow">Amazon RDS now offers easier relational database support </a> (MySql for now). I haven't tried this out yet though, so can't tell you how well it works.Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-37687435176992049712009-11-13T16:42:54.998+00:002009-11-13T16:42:54.998+00:00Here is the RI catch I mentioned in my prev post.....Here is the RI catch I mentioned in my prev post...( see "Important Notes about Purchases" section )<br /><br />http://aws.amazon.com/ec2/reserved-instances/golfdudehttps://www.blogger.com/profile/03082609997941250721noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-36541595021420557282009-11-13T16:38:07.772+00:002009-11-13T16:38:07.772+00:00Hi Niel,
I just got my server up with the same im...Hi Niel,<br /><br />I just got my server up with the same image config ( and setup log-bin backups to s3 and weekly backups also ). I am also tempted to get a reserved instance ( RI ) - but one catch I just learned is that with a RI, you cannot upgrade a reserved instance. ie the reserved instance is tied to the type of an instance. So if you have a small reserved instance, and decide to upgrade ur current small instance to a large instance, you cannot use the reserved instance. You have to get another reserved instance for the large instance. Check the docs. Might as well get a large reserved instance and a large instance. But if you do not have the need, then reserved instance is an obvious choice...golfdudehttps://www.blogger.com/profile/03082609997941250721noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-19448758043202945322009-11-13T16:31:29.621+00:002009-11-13T16:31:29.621+00:00This post was a really big help. I ended up creat...This post was a really big help. I ended up creating my own AMI with Fedora8, Tomcat6.0, ApacheWebServer (for front-end), and MySQL. Your instructions on setting up EBS was perfect.<br /><br />As far as cost, have you considered using a reserved instance? It looks like it could save some significant cash. I've been experimenting with OnDemand instances, but I think I'm going to go ultimately go with a reserved instance.Niel Eydehttps://www.blogger.com/profile/04242841254197210612noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-48750769715453929622009-11-11T21:04:04.412+00:002009-11-11T21:04:04.412+00:00@Fred: sounds quite non-standard to me too. Haven&...@Fred: sounds quite non-standard to me too. Haven't found why this approach was taken.Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-5645247554838031252009-11-11T21:02:16.195+00:002009-11-11T21:02:16.195+00:00@gd: strange, I can't remember having this pro...@gd: strange, I can't remember having this problem. Can't help you there...<br /><br />@pady: Maybe Fred's question above clarifies it a bit (though I guess you read that one already)?<br />Otherwise the next thing to do is a find/grep at root level...Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-37825712889955074202009-11-11T10:05:59.062+00:002009-11-11T10:05:59.062+00:00To my previous post, who is kicking off webuser/he...To my previous post, who is kicking off webuser/helloworld/bin/run_apache ? I did a find/grep on etc and cannot find a reference ? Have to be missing something simple...<br /><br />thx<br /><br />padygolfdudehttps://www.blogger.com/profile/03082609997941250721noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-22227751145705300502009-11-11T09:57:53.714+00:002009-11-11T09:57:53.714+00:00I had to make a change to httpd.conf in this insta...I had to make a change to httpd.conf in this instance and I used kill -9 to kill all the processes as init.d/httpd stop did not work. I noticed that the instance restart uses /home/webuser/helloworld/.../httpd.conf to setup apache. But init.d/httpd uses /etc/httpd. Curious on how the original "http" is getting started. I couldnt find anything in inetd.conf. Maybe I asm missing something simple. Any ideas ?<br /><br />Thx<br /><br />padygolfdudehttps://www.blogger.com/profile/03082609997941250721noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-64217251014094689702009-11-10T23:17:27.232+00:002009-11-10T23:17:27.232+00:00Awesome article. Quick question: In AWS, after cre...Awesome article. Quick question: In AWS, after creating a ebs volume, the "attach volume" button is disabled for me. Any ideas ?<br /><br />Thanks<br /><br />gdgolfdudehttps://www.blogger.com/profile/03082609997941250721noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-47191883271019112892009-06-12T23:57:25.754+01:002009-06-12T23:57:25.754+01:00The starting point of this AMI was the "Java ...The starting point of this AMI was the "Java Web Starter" AMI:<br /> ami-45e7002c<br /> /aws-console-quickstart-amis/tomcat/1.1/tomcatquickstart.manifest.xml <br /><br />As Techie said, it runs the Apache Web Server via the command:<br />/usr/sbin/httpd -f /home/webuser/helloworld/conf/httpd.conf<br /><br />The config file:<br />/home/webuser/helloworld/conf/httpd.conf <br />configures it to run the server as "webuser", not "apache", and it keeps the Web pages, pid file, logs, etc. in<br /> /home/webuser/helloworld<br />instead of the standard places.<br /><br />Furthermore, it includes the lines:<br /> LoadModule jk_module /etc/httpd/modules/mod_jk.so<br /> JkWorkersFile /home/webuser/helloworld/conf/workers.properties<br /> JkLogFile /home/webuser/helloworld/logs/mod_jk.log<br /> JkLogLevel info<br /> JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "<br /> JkMount /* wlb<br />which configure it to pass all HTTP requests to Tomcat, as documented in the link:<br />http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html<br />that MrRe posted.<br /><br />That explains HOW it is specifying its config file, and HOW that config file arranges to forward requests to Tomcat.<br /><br />My question is WHY is it launched with a config file that is not in the standard place (/etc/httpd/conf/httpd.conf)? And WHY is it launched from cron instead of from the standard startup files?<br /><br />The AMI has standard /etc/rc.d/init.d files and /etc/rc.d/rc*.d sym links<br />to cause the various files to stop (K) and start (S) automatically<br />at reboot. However it does not have any S links for tomcat,<br />apache, or mysql, so they don't get started. It has only K links<br />for them. Instead, it starts them from cron via the<br />/var/spool/cron/root file which contains:<br /><br /># restart tomcat on reboot<br />@reboot /etc/init.d/tomcat5 start<br /><br /># restart apache on reboot<br />@reboot /home/webuser/helloworld/bin/run_apache<br /><br /># restart mysql server on reboot<br />@reboot /etc/init.d/mysqld start<br /><br /><br />Any idea why it would have been set up this way?<br />Why not use the standard S links, and the standard<br />config files?<br /><br />Thanks,<br />--Fred StlukaUnknownhttps://www.blogger.com/profile/13064059274879122023noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-88754159966318772752009-05-31T12:21:06.453+01:002009-05-31T12:21:06.453+01:00@MrRe: I haven't used the loadbalancing features o...@MrRe: I haven't used the loadbalancing features of AWS yet so can't help you there. Depending on the type of your application, you can potentially immediately use the AWS auto-scaling and load balancing. If your app is completely stateless, it should be easy to setup. Otherwise, you'll have to take provision for it in your code and setup to handle multiple instances accessing for example the database storage area (as you mention). Recently AWS announced new <A HREF="http://aws.amazon.com/autoscaling/" REL="nofollow">auto-scaling</A> and <A HREF="http://aws.amazon.com/elasticloadbalancing/" REL="nofollow">load-balancing</A> features, maybe you can find some more info there regarding your questions. Good luck!Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-83942867472281627652009-05-29T22:17:59.450+01:002009-05-29T22:17:59.450+01:00attaching apache to tomcat
http://tomcat.apache....attaching apache to tomcat <br /><br />http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html<br /><br />Thanks<br />RogerAnonymoushttps://www.blogger.com/profile/06006058979622553761noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-26657676766911481662009-05-29T15:00:35.401+01:002009-05-29T15:00:35.401+01:00Very cool thanks! will help get me up and running ...Very cool thanks! will help get me up and running quickly!<br /><br />Just wondering how will this work if/when you need to scale up; running multiple EC2 instances; in terms of the following<br /><br />- from a DNS load balancing point of view?<br />- from MySQL sharing the same storage area?<br /><br />Thanks<br />RogerAnonymoushttps://www.blogger.com/profile/06006058979622553761noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-815970729245252622009-05-03T12:17:00.000+01:002009-05-03T12:17:00.000+01:00Good point, because I have Apache mentioned as sof...Good point, because I have Apache mentioned as software pre-installed on the AMI.<br />But it does <B>seem</B> it is not being used to forward requests, and that Tomcat is also serving HTTP. I need to do some more investigating to be sure...<br />httpd is running but only with a helloworld config file; you can see it when you 'ps -ef|grep httpd':<br /><br />/usr/sbin/httpd -f /home/webuser/helloworld/conf/httpd.confTechiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-56815085243045675642009-05-01T07:20:00.000+01:002009-05-01T07:20:00.000+01:00I am using this Java Web Starter AMI and your blog...I am using this Java Web Starter AMI and your blog to get myself started in EC2. Thanks a ton for the clear explanation. I have a question though. How is Apache forwarding all the requests to tomcat. Where can I find this exact config. I am not a linux guru. Kindly help.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-43549160032404843142009-03-19T09:02:00.000+00:002009-03-19T09:02:00.000+00:00Haven't tried it, but I guess that won't be a prob...Haven't tried it, but I guess that won't be a problem because you get an AMI id for each AMI you register. That id seems to be the unique identifier of an AMI.Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-71073254062783328482009-03-17T21:07:00.000+00:002009-03-17T21:07:00.000+00:00Just wanted to say thank you for the GREAT post! Y...Just wanted to say thank you for the GREAT post! You saved me (and non-profit org I work for) hours of "yahooing", "googling" and countless trial and error. <BR/>Btw, have you tried modifying existing AMI and then saving it in the same S3 bucket with the same manifest name? Is it possible?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-23712937979663719042009-03-16T00:21:00.000+00:002009-03-16T00:21:00.000+00:00Amazing blog!!really got me started with Amazon EC...Amazing blog!!<BR/>really got me started with Amazon EC2.<BR/>Keep writing!<BR/>AmirUnknownhttps://www.blogger.com/profile/09018249462535632671noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-15578531989361994442009-03-08T12:57:00.000+00:002009-03-08T12:57:00.000+00:00For February it was in total $69.82. The AMI ran t...For February it was in total $69.82. The AMI ran the whole month for a total of 672 hours. In January it only ran 324hrs and that was $42.73.Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-82155169335357425942009-02-24T02:45:00.000+00:002009-02-24T02:45:00.000+00:00Pretty sweet. What's your average monthly cost for...Pretty sweet. What's your average monthly cost for this setup?Daniel D. Shawhttps://www.blogger.com/profile/02387295566968749036noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-11523272155452012502009-02-11T20:45:00.000+00:002009-02-11T20:45:00.000+00:00Thanks, I will definitely try out this AMI image. ...Thanks, I will definitely try out this AMI image. I appreciate the very well-written article!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-69543447180377872282009-01-22T19:15:00.000+00:002009-01-22T19:15:00.000+00:00No, no plans for that by me :-). I agree that's th...No, no plans for that by me :-). I agree that's the only not-so-great-thing about this AMI: JDK 7 is way too advanced, I think <A HREF="https://jdk7.dev.java.net/" REL="nofollow">it's not even officially out yet</A>.<BR/>But it should not be too hard to also install JDK 6, and make the settings that you use that JDK instead of JDK 7. In Ubuntu you can do something like 'sudo update-alternatives –-config javac' to configure the JDK /usr/bin/javac should be set to. Must be possible in Fedora...Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-36581496634974164962009-01-22T15:30:00.000+00:002009-01-22T15:30:00.000+00:00Great article, it was clear and concise. I used yo...Great article, it was clear and concise. I used your AMI to bring up a server with a java stack. <BR/><BR/>I found an issue with the configuration of the AMI and thought you might want to know about it.<BR/><BR/>The 1.7 version of java has issues loading keys from a keystore. This functionality is necessary for configuring tomcat to run with https. <BR/><BR/>The only solution that I have found for this problem, so far, is to replace java 1.7 with a sun version of the jdk (1.6).<BR/><BR/>I'm wondering if you'd be interested in building the same AMI with a java 1.6? That would make it much easier for me :)Coryhttps://www.blogger.com/profile/11924133430625733806noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-42945613605083341392009-01-19T12:17:00.000+00:002009-01-19T12:17:00.000+00:00Thanks, good to know!Thanks, good to know!Techiehttps://www.blogger.com/profile/09242813498513889831noreply@blogger.comtag:blogger.com,1999:blog-8474871406958844140.post-60656225899411044112009-01-19T01:32:00.000+00:002009-01-19T01:32:00.000+00:00You do get charged for all of the EBS volume even ...You do get charged for all of the EBS volume even if you are not using some blocks on it.<BR/><BR/>Beware of taking snapshots of an EBS volume holding a database without flushing tables, locking the database, and freezing the file system during snapshot creation (which can be fast). <BR/><BR/>The ext3 file system does not support freezing by itself, so the file system may not be consistent, and the database may be corrupt when you try to restore.<BR/><BR/>The procedure I outlined in the tutorial describes how to take consistent snapshots with XFS, but I have not tested this with Fedora.<BR/><BR/>http://ec2ebs-mysql.notlong.comEric Hammondhttps://www.blogger.com/profile/11497273970795271072noreply@blogger.com