Replication and Binary Logging Options and Variables
1441
This is due to the fact that, if the
--relay-log
[1455]
option is not specified, the relay log files
contain the host name as part of their file names. (This is also true of the relay log index file if the
--relay-log-index
[1455]
option is not used. See
Section 16.1.2, “Replication and Binary
Logging Options and Variables”
, for more information about these options.)
To avoid this problem, use the same value for
--relay-log
[1455]
on the new slave that
was used on the existing slave. (If this option was not set explicitly on the existing slave, use
existing_slave_hostname-relay-bin
.) If this is not feasible, copy the existing slave's
relay log index file to the new slave and set the
--relay-log-index
[1455]
option on the new
slave to match what was used on the existing slave. (If this option was not set explicitly on the
existing slave, use
existing_slave_hostname-relay-bin.index
.) Alternatively—if you have
already tried to start the new slave (after following the remaining steps in this section) and have
encountered errors like those described previously—then perform the following steps:
a. If you have not already done so, issue a
STOP SLAVE
on the new slave.
If you have already started the existing slave again, issue a
STOP SLAVE
on the existing slave
as well.
b. Copy the contents of the existing slave's relay log index file into the new slave's relay log index
file, making sure to overwrite any content already in the file.
c. Proceed with the remaining steps in this section.
3. Copy the
master.info
and
relay-log.info
files from the existing slave to the new slave if
they were not located in the data directory. These files hold the current log coordinates for the
master's binary log and the slave's relay log.
4. Start the existing slave.
5. On the new slave, edit the configuration and give the new slave a unique
server-id
[1442]
not
used by the master or any of the existing slaves.
6. Start the new slave. The slave will use the information in its
master.info
file to start the
replication process.
16.1.1.10. Setting the Master Configuration on the Slave
To set up the slave to communicate with the master for replication, you must tell the slave the
necessary connection information. To do this, execute the following statement on the slave, replacing
the option values with the actual values relevant to your system:
mysql>
CHANGE MASTER TO
->
MASTER_HOST='master_host_name',
->
MASTER_USER='replication_user_name',
->
MASTER_PASSWORD='replication_password',
->
MASTER_LOG_FILE='recorded_log_file_name',
->
MASTER_LOG_POS=recorded_log_position;
Note
Replication cannot use Unix socket files. You must be able to connect to the
master MySQL server using TCP/IP.
The
CHANGE MASTER TO
statement has other options as well. For example, it is possible to set up
secure replication using SSL. For a full list of options, and information about the maximum permissible
length for the string-valued options, see
Section 13.4.2.1, “
CHANGE MASTER TO
Syntax”
.
16.1.2. Replication and Binary Logging Options and Variables
The next few sections contain information about
mysqld
options and server variables that are used in
replication and for controlling the binary log. Options and variables for use on replication masters and
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...