目录
canal
定位: 基于数据库增量日志解析,提供增量数据订阅&消费,目前主要支持了mysql
原理:
- canal模拟mysql slave的交互协议,伪装自己为mysql slave,向mysql master发送dump协议
- mysql master收到dump请求,开始推送binary log给slave(也就是canal)
- canal解析binary log对象(原始为byte流)
官网文档/源码(可谷歌右键翻译,有详细的接入案例):https://github.com/alibaba/canal
网上好的学习链接:https://www.jianshu.com/p/6299048fad66
https://www.jianshu.com/p/6299048fad66
源码结构解析:http://www.tianshouzhi.com/api/tutorials/canal/380
源码启动时序图:https://www.jianshu.com/p/d7d1b42242f1
parser