32.6. Replication as an Aid to Backup


If your MySQL server acts as a master in a replication setup, you can use a slave server to make your backups instead of backing up the master:

1.

Cause the server to stop processing updates received from the master. You can do this by stopping the server, or by issuing a STOP SLAVE SQL_THREAD statement. In the latter case, you should also flush the tables to force pending changes to disk.

2.

Make a backup of the slave's databases. The allowable methods depend on whether you stop the server or leave it running. For example, if you stop the server, you cannot use any program that must connect to it, such as mysqldump or mysqlhotcopy.

3.

Restart the server if you stopped it. If you left it running, restart the SQL thread by issuing a START SLAVE SQL_THREAD statement.

The advantage of making a backup this way is that it doesn't take place on the master server. Thus, the master need not be interrupted at all, and the backup procedure does not impose any extra disk or processing load on it.



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net