Oracle 5.0 Reference Manual page 1457

Table of Contents

Advertisement

An alternative to using a bare dump, is to use the
appends the
shell>
mysqldump --all-databases --master-data >dbdump.db
3. In the client where you acquired the read lock, release the lock:
mysql>
UNLOCK TABLES;
Alternatively, exit the first session to release the read lock.
When choosing databases to include in the dump, remember that you will need to filter out databases
on each slave that you do not want to include in the replication process.
You will need either to copy the dump file to the slave, or to use the file from the master when
connecting remotely to the slave to import the data.
16.1.1.6. Creating a Data Snapshot Using Raw Data Files
If your database is particularly large, copying the raw data files may be more efficient than using
mysqldump
However, using this method with tables in storage engines with complex caching or logging algorithms
may not give you a perfect "in time" snapshot as cache information and logging updates may not have
been applied, even if you have acquired a global read lock. How the storage engine responds to this
depends on its crash recovery abilities.
In addition, this method does not work reliably if the master and slave have different values for
ft_stopword_file
copying tables having full-text indexes.
If you are using
snapshot. This tool records the log name and offset corresponding to the snapshot to be later used on
the slave. MySQL Enterprise Backup is a nonfree (commercial) tool that is not included in the standard
MySQL distribution. See
Otherwise, you can obtain a reliable binary snapshot of
MySQL Server.
To create a raw data snapshot of
a remote copy tool such as
snapshot tool such as dump, providing that your MySQL data files exist on a single file system. If you
are replicating only certain databases then make sure you copy only those files that related to those
tables. (For InnoDB, all tables in all databases are stored in the shared tablespace files, unless you
have the
innodb_file_per_table
You may want to specifically exclude the following files from your archive:
• Files relating to the
• The
master.info
• The master's binary log files.
• Any relay log files.
To get the most consistent results with a raw data snapshot you should shut down the master server
during the process, as follows:
1. Acquire a read lock and get the master's status. See
Master Binary Log
How to Set Up Replication
CHANGE MASTER TO
and importing the file on each slave.
[453],
ft_min_word_len
tables, you can use the MySQL Enterprise Backup tool to obtain a consistent
InnoDB
Section 22.2, "MySQL Enterprise Backup"
MyISAM
or rsync, an archiving tool such as
scp
database.
mysql
file.
Coordinates".
--master-data
statement required on the slave to start the replication process.
[452], or
ft_max_word_len
InnoDB
tables you can use standard copy tools such as
option enabled.)
Section 16.1.1.4, "Obtaining the Replication
1437
option, which automatically
[452]
and you are
for detailed information.
tables only after shutting down the
or tar, or a file system
zip
or copy,
cp

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents