Tuesday, June 15, 2010

Amazon's EBS backed AMI vs S3 backed AMI

Now that you are convinced, Amazon EC2 cloud is the way to go, which one will you choose EBS (Elastic Block Store) backed AMI or S3 (Simple Storage Service) backed AMI. Different factors that come into play in making the decision are listed below.
FactorEBS backed AMI'sS3 backed AMI's
Storage Size1TB10GB
Instances can be stoppedYesNo
Boot TimeFaster (~1min)Slower (~5mins)
Local Instance StoreNot AvailableAvailable
Data PersistenceEBS attached as volume (persist)S3 is the root partition (doesn't persist)
AMI CreationEasier and can be done using APINo API available for Linux
ChargesVolume Storage + storage usage + AMI Storage + Instance usageAMI Storage + instance usage
Customized AMI Storage ChargesLower (charged only for the changes)higher (full storage charge)
Instance Usage ChargeNo charge for stopped instances. Charge full instance hour for every transition from stopped to running state (.10 for full hour running, .30 for restarting twice in a hour)Not Applicable

Amazon EC2 Limitations:
  • 20 running instances
  • Overall instance limit = 4xthe running instance limit
  • 100 Amazon EBS Volumes or 20TB total volume storage
  • 100 Security Groups

Friday, February 5, 2010

Mistakes by a new Mac guy, When Installing Ruby, Rubygems, Rails, IntegrityApp, Mysql, Apache, Gems etc on Mac OS X 10.5 (Leopard)

Below are some of the mistakes and solutions, I did as a new Mac guy.

  • Couldn't find ruby header files, when installing some gems. Thats because Mac didn't have the Ruby dev package installed. You have to dowload and install Ruby-dev package.
  • Installed apache in /usr/local without knowing Mac comes with an apache. I was changing the http.conf file under /usr/local/apache where trying to start the default installation. Make sure you are changing httpd.conf and running the correct version of apache.
  • When I tried to start Mongrel, got the error "didn't have rails". But when you type rails -v at the terminal, it gave the correct version. I found rails was not completely installed, it was missing some packages, found out using command "gem list". I uninstalled rails gem and installed it again.
  • While installing gems, I got "c compiler not found in path" and "make not found" errors. It is logical to assume mac comes with "c compiler" and "make" when it have built-in ruby. But thats not the case, So, i have to install XCode to fix this issue.
  • Could not install mysql and do_mysql gem because of error in extconfig.h. Reason, it was not finding the mysql installation. I have to run the gem install with couple of special attributes to install it, thanks to the great post http://benr75.com/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard found in google.
  • When installing data_objects gem, had a strange error "couldn't activate data_objects 0.10.0, because 0.10.1 already activated". Looks like I already had the latest version installed and trying to install the old version again. I didn't install the old version.
  • Type mysql in the terminal, it said "command not found". I have to go the installation folder when mysql command is and run from there. Another option is you can add mysql/bin folder to path.
  • Typing mysql, took me to mysql prompt. I am able to see the databases but when I tried to create a new database it said, I didn't have permission. I have to login using command "mysql --user=root"
  • Phusion Passenger with Apache was not working. When I tried the url, it said didn't have permission to access the directory. I had to change "http.conf" to allow the directory browsing for Passenger to work.
  • When tried to run "rake test", got errors saying "cucumber gem was missing", but I already ran "gems:install" and installed all the gems necessary for the rails project. I had to run "sudo rake gems:install RAILS_ENV=test" to install the gems necessary for test environment
Please leave a comment if you find this post helpful.