Troubleshooting Replication
1510
and to send them to the 5.0 slaves. The slaves recognize the old format and handle it properly. Binary
logs created by the master subsequent to the upgrade are in 5.0 format. These too are recognized by
the 5.0 slaves.
In other words, when upgrading to MySQL 5.0, the slaves must be MySQL 5.0 before you can upgrade
the master to 5.0. Note that downgrading from 5.0 to older versions does not work so simply: You must
ensure that any 5.0 binary log or relay log has been fully processed, so that you can remove it before
proceeding with the downgrade.
Some upgrades may require that you drop and re-create database objects when you move from
one MySQL series to the next. For example, collation changes might require that table indexes be
rebuilt. Such operations, if necessary, will be detailed at
Section 2.19.1.2, “Upgrading from MySQL
4.1 to 5.0”
. It is safest to perform these operations separately on the slaves and the master, and to
disable replication of these operations from the master to the slave. To achieve this, use the following
procedure:
1. Stop all the slaves and upgrade them. Restart them with the
--skip-slave-start
[1462]
option
so that they do not connect to the master. Perform any table repair or rebuilding operations needed
to re-create database objects, such as use of
REPAIR TABLE
or
ALTER TABLE
, or dumping and
reloading tables or triggers.
2. Disable the binary log on the master. To do this without restarting the master, execute a
SET
sql_log_bin = 0
statement. Alternatively, stop the master and restart it without the
--log-
bin
[1467]
option. If you restart the master, you might also want to disallow client connections. For
example, if all clients connect using TCP/IP, use the
--skip-networking
[421]
option when you
restart the master.
3. With the binary log disabled, perform any table repair or rebuilding operations needed to re-create
database objects. The binary log must be disabled during this step to prevent these operations from
being logged and sent to the slaves later.
4. Re-enable the binary log on the master. If you set
sql_log_bin
[494]
to 0 earlier, execute a
SET sql_log_bin = 1
statement. If you restarted the master to disable the binary log, restart it
with
--log-bin
[1467]
, and without
--skip-networking
[421]
so that clients and slaves can
connect.
5. Restart the slaves, this time without the
--skip-slave-start
[1462]
option.
16.4.4. Troubleshooting Replication
If you have followed the instructions but your replication setup is not working, the first thing to do is
check the error log for messages. Many users have lost time by not doing this soon enough after
encountering problems.
If you cannot tell from the error log what the problem was, try the following techniques:
• Verify that the master has binary logging enabled by issuing a
SHOW MASTER STATUS
statement. If
logging is enabled,
Position
is nonzero. If binary logging is not enabled, verify that you are running
the master with the
--log-bin
[1467]
option.
• Verify that the master and slave both were started with the
--server-id
[1442]
option and that the
ID value is unique on each server.
• Verify that the slave is running. Use
SHOW SLAVE STATUS
to check whether the
Slave_IO_Running
and
Slave_SQL_Running
values are both
Yes
. If not, verify the options that
were used when starting the slave server. For example,
--skip-slave-start
[1462]
prevents
the slave threads from starting until you issue a
START SLAVE
statement.
• If the slave is running, check whether it established a connection to the master. Use
SHOW
PROCESSLIST
, find the I/O and SQL threads and check their
State
column to see what they
Содержание 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 ...