Ask HN: Explain AWS
1–10 of 34 posts
Re: Ask HN: Explain AWS
#2You can run MySQL off of the transient disk ("/mnt") but you should consider running it off of an EBS volume. One reason is because you won't lose the disk if something happens to the instance. Another is that you can use the snapshots feature to create instant backups of your database. Later on you can create new EBS volumes from a snapshot (which is really cool for building a stage environment with production data).
This may sound a bit complicated when you're just starting out. It was for me anyway so after working with AWS for a couple years I started working on a development and deployment tool for EC2. The configuration is entirely via a Ruby DSL.
You define the properties of your environments and roles with the machines DSL (including EBS volumes) and you script your repeatable processes (like deployments) with the routines DSL:
http://github.com/solutious/rudy/blob/0.7/Rudyfile
If Python is more your style, there's boto: http://code.google.com/p/boto/
Re: Ask HN: Explain AWS
#3If you're running MySQL on EC2, it's pretty straightforward. You get an EBS volume for your database and back that volume up to Amazon's S3 service. S3 will then provide multi-site redundancy for your data in the event of AWS availability zone failure.
Re: Ask HN: Explain AWS
#4Re: Ask HN: Explain AWS
#5Re: Ask HN: Explain AWS
#6Re: Ask HN: Explain AWS
#7Every EC2 instance has about 150GB of transient disk space. It works like a regular disk but once you shutdown the instance (or in the rare event the instance fails) the disk is gone forever. To solve this problem, Amazon provides EBS volumes ("elastic block storage"). These are like raw disks that you can create on the fly. You create one, attach it to your instances, give it a filesystem, and then mount it. You can…
Re: Ask HN: Explain AWS
#8http://developer.amazonwebservices.com/connect/entry.jspa?ex...
If you take the approach described in the above article, you should think about creating a symbolic link to your EBS volume instead of changing MySQL configuration file.
Re: Ask HN: Explain AWS
#9b. You'll have to use EBS if you want persistent disk storage with an AWS instance. Otherwise when you reboot, goodbye to everything on your harddisk.
But, seriously, reconsider your aims of putting up a 24/7 web hosted up on EC2. You're wasting money.
Re: Ask HN: Explain AWS
#10Every EC2 instance has about 150GB of transient disk space. It works like a regular disk but once you shutdown the instance (or in the rare event the instance fails) the disk is gone forever. To solve this problem, Amazon provides EBS volumes ("elastic block storage"). These are like raw disks that you can create on the fly. You create one, attach it to your instances, give it a filesystem, and then mount it. You can…
Two issues that burned me a couple of months ago with EC2 and Elastic Block:
I built my server and got it running just right. I then wanted to back it up, so I bundled it (save your instance to S3) but forgot to register it(list your S3 bundle as a privately available AMI). When I terminated my instance I wasn't able to restart it, because it wasn't available in my list of registered AMI's. I had to rebuild my server from scratch.
The second problem that I had was in rebuilding my database after my instance terminated. Postgres keeps the log files (transactions the database has completed) in the install folder and the data file(what the database has stored) in the storage folder. When I terminated my instance, I lost all the log files that were stored on the EC2 'disk'. I had the data file on elastic block, but the log files were gone. The standard recovery process for postgres needs log files.
It took me a day to figure out how to rebuild the database from just the data files. I now have both the database and the log files on my elastic block image. Hopefully that will help the next time I kill my server. :) I also now have automated backups of everything.