EBS SNAPSHOT - freeze mysql - lock tables -

Start a MySQL session on the instance, using the password
mysql -u root -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!

MYSQL
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

UNIX
INSTALL --> xfsprogs.i386 : Utilities for managing the XFS filesystem
yum install xfsprogs.i386

then freeze
xfs_freeze -f /vol

On your local system (which has the EC2 API command line tools installed) create a snapshot of the EBS volume. Make a note of the snapshot id (say, snap-SSSS1111).

DO YOUR SNAPSHOT on amazon platform THEN

Back in the same MySQL session on the instance, unfreeze the file system, release the database lock, and you're done!

UNIX
SYSTEM sudo xfs_freeze -u /vol

MYSQL
UNLOCK TABLES;
EXIT

Latest Post

Popular Post

Our Skills

Author

Project Director Information Architect Database Administrator Unix Administrator Senior Developer Project Manager Product Manager Web Marketer Cloud Engineer

Contact Us

For any questions or project ideas please contact me at the following.

I'm here