Before moving on to my questions, I suggest you back up the MySQL database to a file that is not saved as a snapshot or in EBS before you start creating the image. (And of course, check that you can restore it to a location other than your production system.)
I use:
mysqldump --add-drop-table -u root -p databasename > database.sql
for backup and:
mysql -u root -p databasename < database.sql
recovery.
- No, you do not need to disable MySQL, but you need to prevent writing to the database when creating AMI.
- Not. Creating AMI also creates a new snapshot of your EBS volume (with the contents as you did when creating the image).
- yes see 2
A bit more information: I prefer to close the database when possible, when taking snapshots or creating images. However, I do not mean the MySQL expert, but here are some recommendations from http://aws.amazon.com/articles/1663?_encoding=UTF8&jiveRedirect=1
Start a MySQL session on the instance using the password above.
mysql -u root -p
In a mysql session, clear the tables on disk and acquire a lock. Reset the file system to disk and freeze it. Do not leave the MySQL session, otherwise you will lose blocking and snapshots of potentially inconsistent database files!
FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; SYSTEM sudo xfs_freeze -f /vol
source share