17.1.2 Replication Formats

来源:互联网 发布:淘宝返红包怎么用 编辑:程序博客网 时间:2024/06/08 05:23
17.1.2 Replication Formats复制格式17.1.2.1 Advantages and Disadvantages of Statement-Based and Row-Based Replication17.1.2.2 Usage of Row-Based Logging and Replication17.1.2.3 Determination of Safe and Unsafe Statements in Binary Logging复制工作因为events被写入到binary log 是从master读取然后在slave上处理。events 是记录在binary log 有不同的格式根据event的类型。不同的复制格式用于对应的binary logging 格式用于当时间是被记录到master的binary log.1.当使用基于statement-based binary logging,  master写SQL语句到binary log.master的复制到slave工作通过执行SQL语句在slave上。这个称为给予语句的复制(SBR),2.当使用基于行格式的记录,master 写events 到binary log 表明表示单个表的记录被改变。master的复制到slave 通过复制events 表明表记录的改变到slave.在 row-based replication, master 写events 到binary log 表明单个表记录的改变3.你也可以配置MySQL 来使用statement-based and row-based的混合记录,取决于 哪个是最合适的用于记录改变. 这个被称为混个日志记录。当使用mixed-format logging, 一个基于语句的log 是默认被使用。依赖某些语句,和使用的存储引擎, log是自动切换到基于行的在特定的例子。在MySQL 5.6,基于语句是默认的MySQL Cluster.   默认的binary logging 格式在所有的MySQL  Cluster NDB 7.3 and MySQL Cluster NDB 7.4 releases is MIXED. 你应该注意MySQL Cluster 复制总是使用基于行的复制,NDB 存储引擎是不兼容tatement-based replication. 当使用混合格式时, binary loging 格式是取决于使用的存储引擎和被执行的语句。

0 0