flink开发中整合flinksql、kafka、mysql、hbase、cdc所需jar记录

在flink开发中,通常会配合flinksql、kafka、mysql、hbase、cdc等一块使用,为避免jar包缺失、冲突,现整理一下。(均是单机部署)

版本说明如下:

flink:1.13.0
kafka:2.11
mysql:8.0
hbase:2.2.3

一、flink+socket

1)socket使用nc命令实现

nc -lk 9000

2)只需要flink-1.13.0解压后的原始的10个jar,不需要其它jar,如下:

二、flink/flinksql+kafka所需jar

flink-connector-kafka_2.11-1.13.0.jar
kafka-clients-2.1.1.jar

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-kafka_2.11</artifactId>
    <version>1.13.0</version>
</dependency>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>2.1.1</version>
</dependency> 

三、flinksql+mysql所需jar

flink-connector-jdbc_2.11-1.13.0.jar
mysql-connector-java-8.0.11.jar

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-jdbc_2.11</artifactId>
    <version>1.13.0</version>
</dependency>
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

 四、flink+hbase所需jar

flink-sql-connector-hbase-2.2_2.11-1.13.0.jar
hadoop-common-2.8.5.jar
hadoop-auth-2.8.5.jar
commons-lang-2.6.jar
commons-logging-1.2.jar
commons-configuration-1.10.jar
guava-11.0.2.jar

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-sql-connector-hbase-2.2_2.11</artifactId>
    <version>1.13.0</version>
</dependency>
<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-common</artifactId>
    <version>2.8.5</version>
</dependency>
<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-auth</artifactId>
    <version>2.8.5</version>
</dependency>
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>11.0.2</version>
</dependency>
<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.6</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>1.2</version>
    </dependency>
<dependency>
    <groupId>commons-configuration</groupId>
    <artifactId>commons-configuration</artifactId>
    <version>1.10</version>
</dependency>

 五、flink+mysql cdc所需jar

flink-connector-mysql-cdc-1.4.0.jar
<dependency>
    <groupId>com.alibaba.ververica</groupId>
    <artifactId>flink-connector-mysql-cdc</artifactId>
    <version>1.4.0</version>
</dependency>

 备注:mysql需要开启binlog

vi /etc/my.cnf
新增下面几行:
server_id=1
log_bin=mysql-bin
binlog_format=ROW
expire_logs_days=30

 

posted @ 2022-11-13 15:30  雷雨客  阅读(1686)  评论(0编辑  收藏  举报