22
33# 简介
44
5- go-mysql-transfer是使用Go语言实现的MySQL数据库实时增量同步工具。能够实时监听MySQL二进制日志(binlog)的变动,将变更内容形成指定格式的消息,发送到接收端。在数据库和接收端之间形成一个高性能、低延迟的增量数据(Binlog)同步管道。
5+ go-mysql-transfer是一款MySQL数据库实时增量同步工具。
6+
7+ 能够监听MySQL二进制日志(Binlog)的变动,将变更内容形成指定格式的消息,实时发送到接收端。从而在数据库和接收端之间形成一个高性能、低延迟的增量数据同步更新管道。
68
79# 特性
810
9- 1、不依赖其它组件,一键部署
11+ 1、简单,不依赖其它组件,一键部署
12+
13+ 2、集成多种接收端,如:Redis、MongoDB、Elasticsearch、RocketMQ、Kafka、RabbitMQ、HTTP API等,无需编写客户端,开箱即用
14+
15+ 3、内置丰富的数据解析、消息生成规则、模板语法
1016
11- 2、集成多种接收端,如:Redis、MongoDB、Elasticsearch、RabbitMQ、Kafka、RocketMQ,不需要再编写客户端,开箱即用
17+ 4、支持Lua脚本扩展,可处理复杂逻辑
1218
13- 3、内置丰富的数据解析、消息生成规则;支持Lua脚本扩展,以处理更复杂的数据逻辑
19+ 5、集成Prometheus客户端,支持监控告警
1420
15- 4、集成Prometheus客户端,支持监控告警
21+ 6、集成Web Admin监控页面
1622
17- 5 、支持高可用集群部署
23+ 7 、支持高可用集群部署
1824
19- 6 、数据同步失败重试
25+ 8 、数据同步失败重试
2026
21- 7、支持全量数据初始化同步
27+ 9、支持全量数据初始化
2228
2329
2430# 原理
@@ -31,13 +37,48 @@ go-mysql-transfer是使用Go语言实现的MySQL数据库实时增量同步工
3137
3238# 与同类工具比较
3339
34- | 特色 | Canal | mysql_stream | go-mysql-transfer |
35- | ---------- | ---------- | ------------ | ------------------------------------------------------------ |
36- | 开发语言 | Java | Python | Golang |
37- | HA | 支持 | 支持 | 支持 |
38- | 接收端 | 编码定制 | Kafka等 | Redis、MongoDB、Elasticsearch、RabbitMQ、Kafka、RocketMQ<br />后续支持更多 |
39- | 数据初始化 | 不支持 | 支持 | 支持 |
40- | 数据格式 | 编码定制 | json(固定) | 规则 (固定)<br />lua脚本 (定制)
40+ <table >
41+ <thead>
42+ <tr>
43+ <th width="20%">特色</th>
44+ <th width="20%">Canal</th>
45+ <th width="20%">mysql_stream</th>
46+ <th width="40%">go-mysql-transfer</th>
47+ </tr>
48+ </thead>
49+ <tbody>
50+ <tr>
51+ <td>开发语言</td>
52+ <td>Java</td>
53+ <td>Python</td>
54+ <td>Golang</td>
55+ </tr>
56+ <tr>
57+ <td>高可用</td>
58+ <td>支持</td>
59+ <td>支持</td>
60+ <td>支持</td>
61+ </tr>
62+ <tr>
63+ <td>接收端</td>
64+ <td>编码定制</td>
65+ <td>Kafka等(MQ)</td>
66+ <td>Redis、MongoDB、Elasticsearch、RabbitMQ、Kafka、RocketMQ、HTTP API <br>后续支持更多</td>
67+ </tr>
68+ <tr>
69+ <td>全量数据初始化</td>
70+ <td>不支持</td>
71+ <td>支持</td>
72+ <td>支持</td>
73+ </tr>
74+ <tr>
75+ <td>数据格式</td>
76+ <td>编码定制</td>
77+ <td>Json(固定格式)</td>
78+ <td>Json(规则配置)<br>模板语法<br>Lua脚本</td>
79+ </tr>
80+ </tbody>
81+ </table >
4182
4283# 安装包
4384
@@ -51,9 +92,9 @@ go-mysql-transfer是使用Go语言实现的MySQL数据库实时增量同步工
5192
52932、设置' GO111MODULE=on '
5394
54- 3、拉取源码 ‘ go get -d github.com/wj596/go-mysql-transfer’
95+ 3、拉取源码 ' git clone https:// github.com/wj596/go-mysql-transfer.git '
5596
56- 3 、进入目录,执行 ‘ go build ’ 编译
97+ 4 、进入目录,执行 ' go build ' 编译
5798
5899# 全量数据初始化
59100
@@ -81,21 +122,41 @@ server_id=1 # 配置 MySQL replaction 需要定义,不要和 go-mysql-transfer
81122
82123# 使用说明
83124
84- 1、[ go-mysql-transfer实现详解] ( https://www.jianshu.com/p/dce9160d298c?_blank )
85-
86- 2、[ 同步到Redis操作说明] ( https://www.jianshu.com/p/c533659a1d83?_blank )
87-
88- 3、[ 同步到MongoDB操作说明] ( https://www.jianshu.com/p/51124c9371f9?_blank )
89-
90- 4、[ 同步到Elasticsearch操作说明] ( https://www.jianshu.com/p/5a9b6c4f318c?_blank )
125+ * [ 高可用集群] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2116627 )
126+ * [ 同步数据到Redis] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064427 )
127+ * [ Redis配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2111996 )
128+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2111997 )
129+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2111998 )
130+ * [ 同步数据到MongoDB] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064428 )
131+ * [ MongoDB配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2111999 )
132+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112000 )
133+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112001 )
134+ * [ 同步数据到RocketMQ] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064429 )
135+ * [ RocketMQ配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112002 )
136+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112003 )
137+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112004 )
138+ * [ 同步数据到Kafka] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064430 )
139+ * [ Kafka配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112005 )
140+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112006 )
141+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112007 )
142+ * [ 同步数据到RabbitMQ] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064431 )
143+ * [ RabbitMQ配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112008 )
144+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112009 )
145+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112010 )
146+ * [ 同步数据到Elasticsearch] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064432 )
147+ * [ Elasticsearch配置] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112011 )
148+ * [ 基于规则同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112012 )
149+ * [ 基于Lua脚本同步] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112013 )
150+ * [ 全量数据导入] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2116628 )
151+ * [ Lua脚本] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064433 )
152+ * [ 基础模块] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112014 )
153+ * [ Json模块] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112015 )
154+ * [ HttpClient模块] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112016 )
155+ * [ DBClient模块] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2112017 )
156+ * [ 监控] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064434 )
157+ * [ 性能测试] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2116629 )
158+ * [ 常见问题] ( https://www.kancloud.cn/wj596/go-mysql-transfer/2064435 )
91159
92- 5、[ 同步到RocketMQ操作说明] ( https://www.jianshu.com/p/18bb121bbf63?_blank )
93-
94- 6、[ 同步到Kafka操作说明] ( https://www.jianshu.com/p/aec8e4c28c06?_blank )
95-
96- 7、[ 同步到RabbitMQ操作说明] ( https://www.jianshu.com/p/ba5f1d3c75f2?_blank )
97-
98- 8、[ 让go-mysql-transfer具备无尽的扩展能力(^_ ^)Lua脚本使用说明] ( https://www.jianshu.com/p/c4b0147d65a7?_blank )
99160
100161# 感谢
101162
@@ -127,3 +188,10 @@ server_id=1 # 配置 MySQL replaction 需要定义,不要和 go-mysql-transfer
127188* redis接收端增加* Sorted* Set数据类型支持
128189* 修复了近来反馈的bug
129190
191+ ** v1.0.3 release**
192+
193+ * 添加了Web Admin监控界面
194+ * 改进了全量数据同步的速度
195+ * 重构了失败重试机制
196+ * 功能优化,如:针对MongoDB添加UPSERT操作、针对消息队列添加了update原始数据保留,等等
197+
0 commit comments