Posts Tagged ‘Server Administration’

Attaching an EBS volume to Amazon EC2 instance

The EC2 backed Amazon’s instances come with a limited storage space by default(8GB to be specific mounted on /). However, some applications may require much more instance space. This can be accomplished by attaching an EBS storage to the your EC2 instance. Attaching extra storage on EC2 instance is pretty easy and you got to follow a few very simple steps:
  • Allocate a new EBS in your amazon AWS EC2 dashboard. The option comes under the heading volumes in the major head Elastic Block Storages. You will be asked for the size you want to allocate. The availability zone must be the same as the Amazon EC2 instance’s zone to which you want to connect this volume to.
  • In the list of volumes, attach the newly created EBS volume to the desired instance(As you select the volume using the checkbox, an option will appear on the top to attach it to an instance).
  • Now connect to your instance using ssh and run sudo fdisk -l. In the meantime do checkout our latest SIP Calculator fdisk will show the list of volumes and your newly created volume should appear unpartioned in this list. Format the file system /dev/xvdf(ubuntu’s external name to your drive) using the following command:
    sudo mkfs.ext4 /dev/xvdf
  • Mount the volume onto the system and add it to /etc/fstab for mounting at the system start(Here we assume that you will mount to /vol, this can be any directory that you like):
    sudo mkdir -m 000 /vol
    echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
    	sudo mount /vol 
  • Thats it, enjoy your extended partition !!

Bundle: Command Not Found: Heroku

Recently, I had an application where we had to use ruby 1.8.7 instead of default ruby on heroku cedar stack(1.9.x) so what we did was following:
  • Create a Heroku instance and deployed our application on the instance.
  • After deploying we changed the ruby version to 1.8.7 in Gemfile and deployed the application back.
  • Results: A dreaded “Bundle: Command not found” error.
We tried installing bundler and many other things but the error wont go away. We requested for a heroku support at that time and they explained that when you change ruby version after the deployment, heroku yet does not changes the gem path so we have to manually set the config using following commands:
heroku config:add GEM_PATH=vendor/bundle/1.8
We tried the solution and this worked for us. The Heroku team however explained that in case you use a custom ruby in a stack then we need to spin up an instance and then add the ruby directive at the time of deploying the application otherwise the gem path would not be configured. I hope this saves time for someone !!