maxwell读取mysql binlog到kafka

下载地址

https://maxwells-daemon.io/

解压压缩包

tar -zxvf maxwell-1.29.0.tar.gz -C /opt/module/

初始化maxwell元数据库

在mysql中为maxwell创建一个数据库

复制 config.properties.example 文件

cp config.properties.example config.properties

修改config.properties文件

producer=kafka
kafka.bootstrap.servers=master:9092

# mysql login info
host=slave3
user=maxwell
password=maxwell

kafka_topic=maxwell

启动maxwell

./maxwell --config /opt/module/maxwell/config.properties

若出现如下错误,则需要修改mysql时区为东8区
在这里插入图片描述

set global time_zone='+8:00'

你可能感兴趣的:(我的笔记,mysql,kafka,数据库)