官方说明:
--log-slave-updates
Command-Line Format |
--log-slave-updates |
Option-File Format |
log-slave-updates |
System Variable Name |
log_slave_updates |
Variable Scope |
Global |
Dynamic Variable |
No |
|
Permitted Values |
Type |
boolean |
Default |
FALSE |
Normally, a slave does not log to its own binary log any updates that are received from a master server. This option tells the slave to log the updates performed by its SQL thread to its own binary log. For this option to have any effect, the slave must also be started with the --log-bin
option to enable binary logging. --log-slave-updates
is used when you want to chain replication servers. For example, you might want to set up replication servers using this arrangement:
A -> B -> C
Here, A
serves as the master for the slave B
, and B
serves as the master for the slave C
. For this to work, B
must be both a master and a slave. You must start both A
and B
with --log-bin
to enable binary logging, and B
with the --log-slave-updates
option so that updates received from A
are logged by B
to its binary log.
这个参数用来配置从服务器上的更新似乎否写二进制日志,默认是不打开的。但是,如果这个从服务器也要作为其他服务器的主服务器,搭建一个链式的复制,那么就需要打开这个选项,这样它的从服务器将获得该从库的二进制日志以进行同步操作。
这个启动参数需要和--logs-bin参数一起使用。如果只打开log-slave-updates而关闭--logs-bin,在数据库启动时会报错。