Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Before going to your questions I would suggest that you back up your MySQL database to a file which is not stored as a snapshot or in an EBS before you start creating the image. (And of course test that you can restore it to somewhere else than your production system.) </p> <p>I use: </p> <pre><code>mysqldump --add-drop-table -u root -p databasename &gt; database.sql </code></pre> <p>to backup and:</p> <pre><code>mysql -u root -p databasename &lt; database.sql </code></pre> <p>to restore.</p> <ol> <li>No, you do not have to shut down MySQL, but you have to prevent writes to the database while create the AMI. </li> <li>No, The creation of a AMI also creates a new snapshot of your EBS volume (with the content as it was at image creation time).</li> <li>yes, see 2</li> </ol> <p>A bit more info: I prefer to shut down the database when possible when snapshoting or creating images. That said I am not by any mean an MySQL expert, but here is some guidance from <a href="http://aws.amazon.com/articles/1663?_encoding=UTF8&amp;jiveRedirect=1" rel="nofollow">http://aws.amazon.com/articles/1663?_encoding=UTF8&amp;jiveRedirect=1</a></p> <p>Start a MySQL session on the instance, using the password you set above.</p> <pre><code>mysql -u root -p </code></pre> <p>In the mysql session, flush the tables to disk and acquire a lock. Flush the file system to disk and freeze it. Do not exit the MySQL session or you will lose the lock and snapshot potentially inconsistent database files!</p> <pre><code>FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; SYSTEM sudo xfs_freeze -f /vol </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload