注意:HDP中Kafka broker的端口是6667,不是9092
如有需要请看:基于HDP使用Flume实时采集MySQL中数据传到Kafka+Hive/HDFS
1.将flume-ng-sql-source-1.5.2.jar,mysql-connector-java.jar放入Flume安装目录lib下
下载地址:Flume采集MySQL数据所需jar包
[root@hqc-test-hdp3 kafka]# cd /usr/hdp/2.5.3.0-37/flume/lib/
2.编写Flume 配置文件mysql_kafka.conf
配置可参考:https://github.com/keedio/flume-ng-sql-source
[root@hqc-test-hdp3 ~]# vim mysql_kafka.conf
agent.sources = r1
agent.channels = c1
agent.sinks = k1
####define source begin
##define sqlSource
agent.sources.r1.channels = c1
agent.sources.r1.type = org.keedio.flume.source.SQLSou