MySQL Patch – MirroredBinlogs (From Google)
这几天看了不少Google针对于MySQL开发的google-mysql-tools,找到一个很有意思的Patch:MirroredBinlogs。 这个Patch通过修改MySQL Replication中Slave IO线程的实现,让该线程在写入relay log的同时,再Mirror了一份与Master端完全一模一样binlog。这里所说
这几天看了不少Google针对于MySQL开发的google-mysql-tools,找到一个很有意思的Patch:MirroredBinlogs。
这个Patch通过修改MySQL Replication中Slave IO线程的实现,让该线程在写入relay log的同时,再Mirror了一份与Master端完全一模一样binlog。这里所说的一模一样不仅仅是binlog的内容完全一样,同时还包括binlog的文件名。也就是说,该线程在Slave端完全copy了一份Master的binlog日志。
在该 Patch 的描述中,该 Patch 产生的初衷是为了解决Slave与Master之前的顺利切换,并保证切换之后其他Slave仍然能够正常从新的Master继续进行复制。
作者设想了如下一个场景:
在 Hierarchical Replication(级联复制)环境中,第一层是有一台 Master ,第二层是两台 Slaves ,这两台Slave主要作用是作为第三层更多 Slave 的 Master 。也就是,第二层的两台 Slave 的角色在整个集群环境中是一个复制代理。如果我们使用的是普通的MySQL,那么中间代理层的两台Slave之间的binlog日志可能会有较大差异,因为两台Slave自身也会有产生binlog的event。而通过使用该Patch之后,通过 Slave IO 线程将第一层中 Master 的binlog完全一模一样的copy到第二层的 Slave 上面,而使这一层的binlog完全一致。这样,当第二层的两台复制代理机器中的一台Crash之后,可以很容易的将第三层中以 前面 Crash 的 Slave 作为 Master 的所有 Slave 可以很容易的切换 Master 到另外一台 代理 Slave 上面。
只不过,开发者已经停止了该Patch的更新,并将该Patch整合到了一个新的叫 GlobalTransactionIds(MySQL Hierarchical Replication & Global Group IDs)的Patch中,只不过该Patch还正在开发中。从 Google 在 GlobalTransactionIds 的介绍中可以看到比其他 Patch 更为详细的一些说明,不知道是否算是对该 Patch 比较重视的一个表现呢? 希望不是我的一厢情愿吧。
自己目前还没有详细测试过 MirroredBinlogs 这个 Patch,也不知道是否奏效,不过我想 Google 应该不会在技术这种事情上拿自己的名声和我们开这种玩笑吧,哈哈。如果有哪位朋友已经做过相关的测试的话,就 Share 一下效果吧…
原文地址:MySQL Patch – MirroredBinlogs (From Google), 感谢原作者分享。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

You can open phpMyAdmin through the following steps: 1. Log in to the website control panel; 2. Find and click the phpMyAdmin icon; 3. Enter MySQL credentials; 4. Click "Login".

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Redis uses a single threaded architecture to provide high performance, simplicity, and consistency. It utilizes I/O multiplexing, event loops, non-blocking I/O, and shared memory to improve concurrency, but with limitations of concurrency limitations, single point of failure, and unsuitable for write-intensive workloads.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL and SQL are essential skills for developers. 1.MySQL is an open source relational database management system, and SQL is the standard language used to manage and operate databases. 2.MySQL supports multiple storage engines through efficient data storage and retrieval functions, and SQL completes complex data operations through simple statements. 3. Examples of usage include basic queries and advanced queries, such as filtering and sorting by condition. 4. Common errors include syntax errors and performance issues, which can be optimized by checking SQL statements and using EXPLAIN commands. 5. Performance optimization techniques include using indexes, avoiding full table scanning, optimizing JOIN operations and improving code readability.

Effective monitoring of Redis databases is critical to maintaining optimal performance, identifying potential bottlenecks, and ensuring overall system reliability. Redis Exporter Service is a powerful utility designed to monitor Redis databases using Prometheus. This tutorial will guide you through the complete setup and configuration of Redis Exporter Service, ensuring you seamlessly build monitoring solutions. By studying this tutorial, you will achieve fully operational monitoring settings
