Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

One of my clients has three EC2 servers on the Amazon cloud, with several attached EBS devices:

Picture.png

server 1 and server 2 are ubuntu micro instances, and server 3, the main production box, is a ubuntu large instance.

I'm want to create a duplicate of server 3 but am wondering if there is an advantage of having 4 attached EBS devices as shown, or if it would be simpler / easier to do it with fewer attached devices.

I don't know too much of the history of these servers, so I'm looking for insight. I do know that server 3 runs programs that require apache, mysql, oracle, java, solr and maybe a few other services.

If I launch a new Ubuntu Large instance I believe it only comes with 7.5 GB of storage - so if I need to store a large database I will need at least 1 other attached EBS device, because I don't think when using Ubuntu's images on EC2 you can increase the size of the main EBS. Is that correct?

And, if I add another EBS device to the instance, I will need to do things like change the path of where apps (like mySql and Oracle) store their data - right?

My apologies for having a somewhat broad question, but in a nutshell, I'd just like to know:

How should I set up additional EBS storage on an Amazon EC2 instance?

share|improve this question
add comment

1 Answer

You have a couple options:

  1. Start the EBS boot instance with a larger root EBS volume. Here's an article wrote describing how to do this: http://alestic.com/2009/12/ec2-ebs-boot-resize

  2. Attach extra EBS volume(s) to the instance. Here's an article I wrote for Amazon describing best practices with an example using a MySQL database: http://aws.amazon.com/articles/1663

I recommend keeping your data separate from your boot disk (option 2) for future maintenance, upgrades, copying between instances, switching architectures, and more.

In the second approach, I demonstrate how to use "bind mounts" so that you don't have to change your application configuration.

For completeness, I should also mention that EC2 instances have (free) ephemeral storage available to them, but since anything stored there is lost forever when the instance is stopped, terminates, or fails, it isn't recommended for most applications.

share|improve this answer
    
Good links and info. Thanks. I had already spent some time on your blog site earlier today researching this. ps: i think you should share some links to ubuntu's AMI search at the bottom of your ami "tabs" :) cloud.ubuntu.com/ami && uec-images.ubuntu.com/releases –  cwd Dec 25 '11 at 0:13
    
Creat artice Eric, I like the approuch of seperating the data into multiple physical chunks. I just started using ec2 to host all my websites/applications myself, so I still need a lot to learn. I have a question, in your article you are creating a volume for mysql. I have a webroot, with php/html applications, and a mysql database. Do you think it would be good to have a volume for both my webroot and mysql. Or should I spreas it even more and create 1 root, 1 mysql, and 1 webroot. –  Saif Bechan Dec 26 '11 at 2:15
    
Saif: One volume for data gets you most of the benefits. Two offers atad more flexibility with more management complexity. I'd probably recommend splitting the web server and database server onto separate instances instead of just separate volumes. –  Eric Hammond Dec 26 '11 at 12:20
    
cwd: Alestic.com is pulling the AMI info from the same data source, just presenting it in a different way. –  Eric Hammond Dec 26 '11 at 12:23
    
@EricHammond - yes I realize that your site is pulling the data from the same source, i just think you should also provide a link to the source. Also you can take a look at: unix.stackexchange.com/questions/28236 –  cwd Jan 3 '12 at 20:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.