Oracle 5.0 Reference Manual page 1460

Table of Contents

Advertisement

6. Configure the slave with the replication coordinates from the master. This tells the slave the binary
log file and position within the file where replication needs to start. Also, configure the slave with the
login credentials and host name of the master. For more information on the
statement required, see
7. Start the slave threads:
mysql>
START SLAVE;
After you have performed this procedure, the slave should connect to the master and catch up on any
updates that have occurred since the snapshot was taken.
If you have forgotten to set the
If you have forgotten to set the
the slave's error log:
Warning: You should set server-id to a non-0 value if master_host
is set; we will force server id to 2, but this MySQL server will
not act as a slave.
You also find error messages in the slave's error log if it is not able to replicate for any other reason.
Once a slave is replicating, you can find in its data directory one file named
named relay-log.info. The slave uses these two files to keep track of how much of the master's
binary log it has processed. Do not remove or edit these files unless you know exactly what you are
doing and fully understand the implications. Even in that case, it is preferred that you use the
MASTER TO
statement to update the status files automatically.
A single snapshot of the master suffices for multiple slaves. To set up additional slaves, use the same
master snapshot and follow the slave portion of the procedure just described.
16.1.1.9. Introducing Additional Slaves to an Existing Replication Environment
To add another slave to an existing replication configuration, you can do so without stopping the
master. Instead, set up the new slave by making a copy of an existing slave, except that you configure
the new slave with a different
To duplicate an existing slave:
1. Shut down the existing slave:
shell>
mysqladmin shutdown
2. Copy the data directory from the existing slave to the new slave. You can do this by creating an
archive using
Ensure that you also copy the log files and relay log files.
A common problem that is encountered when adding new replication slaves is that the new slave
fails with a series of warning and error messages like these:
071118 16:44:10 [Warning] Neither --relay-log nor --relay-log-index were used; so
replication may break when this MySQL server acts as a slave and has his hostname
changed!! Please use '--relay-log=new_slave_hostname-relay-bin' to avoid this problem.
071118 16:44:10 [ERROR] Failed to open the relay log './old_slave_hostname-relay-bin.003525'
(relay_log_pos 22940879)
071118 16:44:10
071118 16:44:10
How to Set Up Replication
Section 16.1.1.10, "Setting the Master Configuration on the
server-id
server-id
statement to change replication parameters. The slave will use the values specified in the
Note
The content of
master.info
on the command line or in my.cnf. See
Logging Options and
server-id
or WinZip, or by performing a direct copy using a tool such as
tar
[ERROR] Could not find target log during relay log initialization
[ERROR] Failed to initialize the master info structure
[1442]
option for the master, slaves cannot connect to it.
[1442]
option for the slave, you get the following error in
overrides some of the server options specified
Section 16.1.2, "Replication and Binary
Variables", for more details.
[1442]
value.
1440
CHANGE MASTER TO
Slave".
and another
master.info
CHANGE
or rsync.
cp

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents