1

How do instances spawned from AMIs work when you have a MySQL database? I think I understand that if you have more than one instance and assign the same Elastic IP to both of them, the incoming traffic gets distributed among both. But what happens when the MySQL database gets updated on one of the instances?

I just need to wrap my mind around what happens when I create an AMI and then launch a new instance to help with traffic.

Thanks for your suggestions.

4
  • MySQL shouldn't "just crash." Figure out why it crashed first. Sep 4, 2012 at 20:48
  • Maybe I should have said that it was terminated for running out of memory.
    – Daddy
    Sep 4, 2012 at 20:56
  • Yes indeed. Add any and all possibly relevant details to your question, and you will get better answers. Sep 4, 2012 at 20:57
  • My question isn't "how do I address memory issues", it is "how does it work to have two instances, created from an AMI snapshot share the same MySQL database, or is it impossible?"
    – Daddy
    Sep 5, 2012 at 0:01

2 Answers 2

2

You won't generally run a separate MySQL database on each instance, but a single MySQL database (or perhaps cluster, later) to which all of your instances connect.

So at minimum you have:

Elastic Load Balancer -> Web Server Instances (on EBS or S3) -> Database Instance (on EBS)

If you need to scale the database, you can implement a MySQL Cluster in EBS instances, or just use Amazon RDS.

1
  • Thanks for the link, sir. This is the solution for me. Implementing it may not be easy but I will just have to try my best
    – Daddy
    Sep 5, 2012 at 20:48
0

If your EC2 instance crashed due to running out of memory you should consider upgrading the instance to a m1.large type or at least m1.small type from the t1.micro type you currently have.

1
  • This does not address my question.
    – Daddy
    Sep 4, 2012 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .