Skip to content

powdersnow-zsy/kth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

中文 | English

简介

mysql到hdfs的实时同步工具,

消费canal发送到kafka的mysql binlog数据,写入hdfs并定时转成hive表

特点

  • 支持多topic,消息过滤
  • 动态配置,无需重启
  • 可配置kafka消费起点时间
  • 自动定时刷新分区

架构

  • kth消费来自kafka的mysql binlog数据,该数据由canal格式化成json后发送给kafka
  • kth将数据格式化成hdfs文件的一行,并且添加时间戳,写入hdfs
  • kth定时add partition,使得hive对应的hive表可查

快速开始

1、修改conf-env.properties配置

2、修改config-env.yml配置

3、添加hive-site.xml

4、按照指定格式配置reloadConf.properties文件:

topics={"topics":[{"tables":[{"db":"db1","tableName":"t1"},{"db":"db2","tableName":"t2"},{"db":"db3","tableName":"t3"}],"topicName":"topic1"},{"tables":[{"db":"db4","tableName":"t4"}],"topicName":"topic2"}]}

此配置项必须进行json压缩。

5、打包:mvn clean install

将./target/kth上传到服务器

6、启动:nohup bash bin/start.sh profiles=production &

联系方式

QQ:346224832

License

kth is under the Apache 2.0 license. See the LICENSE file for details.