1

I'm afraid there may not be a way to do this since we're not load balancing, but I'd like to know if there is any way to upgrade an EC2 EBS backed instance to a larger size without downtime.

First of all, we have everything on one instance: both our app and our database (mongodb).

This is along the lines i'm thinking: I know you can create snapshots of your EBS and an AMI of your instance. We already have an AMI and we create hourly snapshots. If I spin up a new separate instance of a larger size and then implement (not sure what the right term is here) the snapshots so that our database is up to date, then I could switch the A record of our domain from the old ip address to the new one. However, I'm afraid that after copying over the data from the snapshot, by the time it takes to change the A record and have that change propagate, the data could potentially be stale. Is there a way to prevent this, and is there a better way to do this than I am suggesting?

Justin Meltzer
  • 621
  • 1
  • 9
  • 18

1 Answers1

1
  1. Give yourself a maintenance window and notify your users of possible downtime.
  2. A few days before your maintenance window, update your DNS entry to have a very small time-to-live value (TTL). For example, 5 minutes.
  3. Stop your instance.
  4. Change the instance's type to the larger type.
  5. Restart your instance.
  6. If you don't have one, take this opportunity to assign an elastic IP.
  7. Update your DNS.

If all goes well, your instance will only be down for a few minutes.

Depending on your DNS entry's time-to-live value, it may take time for your DNS change to propagate. During this time, even if your instance is up and running, your customers won't be able to get to your instance. For this reason, give yourself an elastic IP address so you can avoid this problem in the future.

Matt Houser
  • 9,709
  • 1
  • 26
  • 25