$ ls ~yifei/notes/

mysql 基础知识 (8) - 主从复制

Posted on:

Last modified:

mysql 有三种主从复制方式

MySQL 传统的高可用解决方案是通过 binlog 复制来搭建主从或一主多从的数据库集群。主从之间的复制模式支持异步模式 (async replication) 和半同步模式 (semi-sync replication)。无论哪种模式下,都是主库 master 提供读写事务的能力,而 slave 只能提供只读事务的能力。在 master 上执行的更新事务通过 binlog 复制的方式传送给 slave,slave 收到后将事务先写入 redo log,然后重放事务,即在 slave 上重新执行一次事务,从而达到主从机事务一致的效果。 

MySQL 的三种日志

  • binlog
  • redo log
  • undo log

参考

WeChat Qr Code

© 2016-2022 Yifei Kong. Powered by ynotes

All contents are under the CC-BY-NC-SA license, if not otherwise specified.

Opinions expressed here are solely my own and do not express the views or opinions of my employer.

友情链接: MySQL 教程站