Oracle 5.0 Reference Manual page 1458

Table of Contents

Advertisement

2. In a separate session, shut down the master server:
shell>
mysqladmin shutdown
3. Make a copy of the MySQL data files. The following examples show common ways to do this. You
need to choose only one of them:
shell>
tar cf /tmp/db.tar ./data
shell>
zip -r /tmp/db.zip ./data
shell>
rsync --recursive ./data /tmp/dbdata
4. Restart the master server.
If you are not using
shutting down the server as described in the following steps:
1. Acquire a read lock and get the master's status. See
Master Binary Log
2. Make a copy of the MySQL data files. The following examples show common ways to do this. You
need to choose only one of them:
shell>
tar cf /tmp/db.tar ./data
shell>
zip -r /tmp/db.zip ./data
shell>
rsync --recursive ./data /tmp/dbdata
3. In the client where you acquired the read lock, release the lock:
mysql>
UNLOCK TABLES;
Once you have created the archive or copy of the database, you will need to copy the files to each
slave before starting the slave replication process.
16.1.1.7. Setting Up Replication with New Master and Slaves
The easiest and most straightforward method for setting up replication is to use new master and slave
servers.
You can also use this method if you are setting up new servers but have an existing dump of the
databases from a different server that you want to load into your replication configuration. By loading
the data into a new master, the data will be automatically replicated to the slaves.
To set up replication between a new master and slave:
1. Configure the MySQL master with the necessary configuration properties. See
"Setting the Replication Master
2. Start up the MySQL master.
3. Set up a user. See
4. Obtain the master status information. See
Binary Log
5. On the master, release the read lock:
mysql>
UNLOCK TABLES;
6. On the slave, edit the MySQL configuration. See
Configuration".
7. Start up the MySQL slave.
8. Execute a
Section 16.1.1.10, "Setting the Master Configuration on the
How to Set Up Replication
tables, you can get a snapshot of the system from a master without
InnoDB
Coordinates".
Configuration".
Section 16.1.1.3, "Creating a User for
Coordinates".
statement to set the master replication server configuration. See
CHANGE MASTER TO
Section 16.1.1.4, "Obtaining the Replication
Replication".
Section 16.1.1.4, "Obtaining the Replication Master
Section 16.1.1.2, "Setting the Replication Slave
Slave".
1438
Section 16.1.1.1,

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents