mysql_CDC方法maxwell基本使用和配置

2017-12-04  本文已影响415人  只有香如故

maxwell 读取binlog

参考网址

docker pull zendesk/maxwell

在docker的镜像是zendesk/maxwell:latest
lmages_id:824058dff591

docker 下创建容器mysql_cdc 3123:3306

配置参数文件

进入容器 vim /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
server-id=1
log-bin=master
binlog_format=row

授予maxwell权限,如果maxwell用户不存在,会自动创建。

mysql> GRANT ALL on maxwell.* to 'maxwell'@'%' identified by 'XXXXXX';

mysql> GRANT SELECT, REPLICATION CLIENT, REPLICATION SLAVE on . to 'maxwell'@'%';

启动maxwell

docker run -it --rm zendesk/maxwell bin/maxwell --user='maxwell' --password='XXXXXX' --host=172.17.0.5 --producer=stdout

07:11:43,445 INFO BinlogConnectorLifecycleListener - Binlog connected.

测试数据与输出

相关字段解释

rowid
mysql不存在类似与oracle的rowid伪列

开发者介绍

maxwell导出信息到rabbitMQ

修改用户名和密码
docker run -d --hostname my-rabbit --name some-rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3.6.10-management

maxwell required

JRE 7 or above
mysql 5.1, 5.5, 5.6, 5.7
kafka 0.8.2 or greater

maxwell最新版v1.10.9已经支持5.7的JSON数据类型,也支持GTID

v1.7.0: "lucky me, lucky mud"
Maxwell 1.7 brings 2 major new, alpha features. The first is Mysql 5.7 support, including JSON column type support and handling of 5.7 SQL, but not including GTID support yet. This is based on porting Maxwell to Stanley Shyko's binlog-connector library.
v1.8.0: "upbeat, honest, contradictory"
In version 1.8.0 Maxwell gains alpha support for GTID-based positions!

上一篇 下一篇

猜你喜欢

热点阅读