MySQL 5.0 FAQ: Replication
2904
•
B.13.10: [2906]
How do I tell whether a master server is using statement-based or row-based binary
logging format?
•
B.13.11: [2907]
How do I tell a slave to use row-based replication?
•
B.13.12: [2907]
How do I prevent
GRANT
and
REVOKE
statements from replicating to slave
machines?
•
B.13.13: [2907]
Does replication work on mixed operating systems (for example, the master runs on
Linux while slaves run on Mac OS X and Windows)?
•
B.13.14: [2907]
Does replication work on mixed hardware architectures (for example, the master
runs on a 64-bit machine while slaves run on 32-bit machines)?
Questions and Answers
B.13.1: Must the slave be connected to the master all the time?
No, it does not. The slave can go down or stay disconnected for hours or even days, and then
reconnect and catch up on updates. For example, you can set up a master/slave relationship over a
dial-up link where the link is up only sporadically and for short periods of time. The implication of this is
that, at any given time, the slave is not guaranteed to be in synchrony with the master unless you take
some special measures.
To ensure that catchup can occur for a slave that has been disconnected, you must not remove
binary log files from the master that contain information that has not yet been replicated to the slaves.
Asynchronous replication can work only if the slave is able to continue reading the binary log from the
point where it last read events.
B.13.2: Must I enable networking on my master and slave to enable replication?
Yes, networking must be enabled on the master and slave. If networking is not enabled, the slave
cannot connect to the master and transfer the binary log. Check that the
skip-networking
[421]
option has not been enabled in the configuration file for either server.
B.13.3: How do I know how late a slave is compared to the master? In other words, how do I
know the date of the last statement replicated by the slave?
Check the
Seconds_Behind_Master
column in the output from
SHOW SLAVE STATUS
. See
Section 16.1.3.1, “Checking Replication Status”
.
When the slave SQL thread executes an event read from the master, it modifies its own time to the
event timestamp. (This is why
TIMESTAMP
is well replicated.) In the
Time
column in the output of
SHOW
PROCESSLIST
, the number of seconds displayed for the slave SQL thread is the number of seconds
between the timestamp of the last replicated event and the real time of the slave machine. You can use
this to determine the date of the last replicated event. Note that if your slave has been disconnected
from the master for one hour, and then reconnects, you may immediately see large
Time
values such
as 3600 for the slave SQL thread in
SHOW PROCESSLIST
. This is because the slave is executing
statements that are one hour old. See
Section 16.2.1, “Replication Implementation Details”
.
B.13.4: How do I force the master to block updates until the slave catches up?
Use the following procedure:
1. On the master, execute these statements:
mysql>
FLUSH TABLES WITH READ LOCK;
mysql>
SHOW MASTER STATUS;
Record the replication coordinates (the current binary log file name and position) from the output of
the
SHOW
statement.
Содержание 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 ...