Day 2 Mysql Replication
I am a programmer , I have my computer so i can do everything , I am good.————Michael Wideneus (MySQL之父)
Replication
is based on the master
server keeping track of all changes to its databases (updates, deletes, and so on) in its binary
log.
复制是通过将所有数据库修改操作记录(更新,删除等)到了日志文件中的主服务器实现的。
The binary
log serves as a written
record of all events
that modify database structure or content (data) from the moment
the server was started.
日志服务器担负着将各类修改记录写入日志文件的职责。从日志服务器被启动的那一刻起,所有修改了数据库结构或者数据的事件,都会被它记录下来。
Typically
, SELECT statements
are not recorded because they modify neither database structure nor content.
一般来说,SELECT语句不会被记录下来,因为他们既不会影响数据库的结构,也不会影响数据库的数据。
Each slave
that connects to the master
requests a copy of the binary
log.
每台接上了主服务器的从服务器都会请求一份二进制日志的拷贝文件。
That is, it pulls
the data from the master
, rather than
the master
pushing
the data to the slave
.
那就是,“从服务器”从“主服务器”那里将日志拉取回来,而非主服务器向从服务器推送日志。
The slave
also executes
the events
from the binary
log that it receives. This has the effect of repeating
the original
changes just as
they were made on the master
.
从服务器会将它收到的二进制日志中所记录的事件再执行一遍,这样就起到了重复这些操作的效果,就好像这些操作在主服务器上被执行时一样。
Tables are created or their structure modified, and data is inserted, deleted, and updated according to
the changes that were originally
made on the master
.
根据主服务器对于各类操作的记录,从服务器上的数据表会相应地被创建或修改、而从服务器上的数据也会被相应地插入、删除或更新。
本文选自:
https://dev.mysql.com/doc/mysql-replication-excerpt/5
.5/en/replication-implementation
.html
生词 | 音标 | 释义 |
---|---|---|
replication | [ˌrɛplɪˈkeʃən] | n. 复制 |
be based on | 基于 | |
master | ['mɑːstə] | adj. 主要的 |
keep track of | 跟踪 | |
binary | ['baɪnəri] | adj. 二进制的 |
serve as | 充当…角色 | |
written | ['rɪtn] | adj. 写入的,成文的 |
event | [ɪ'vɛnt] | n. 事件 |
from the moment | 从某一刻开始 | |
typically | ['tɪpɪkli] | 通常,一般来说 |
statement | [ˈsteɪtmənt] | n. 程序语句 |
neither nor | 既不,也不 | |
slave | [sleɪv] | n. 从服务器 |
pull | [pʊl] | vt. 拉取 |
rather than | 而不是 | |
push | [pʊʃ] | vt. 推送 |
execute | ['ɛksɪkjut] | vt. 执行 |
have the effect of | 有…效果 | |
repeat | [rɪ'pit] | vt. 重复 |
original | [ə'rɪdʒənl] | adj. 最初的,原来的 |
just as | 好像 | |
according to | 根据 | |
originally | [ə'rɪdʒənəli] | adv. 原来,原本 |