problems_flink

problems_flink

1 flink中使用kafka作为数据源报错

报错如下:

[2019-12-12 21:28:24,224] ERROR Closing socket for 192.168.8.120:9092-192.168.8.1:50966 because of error (kafka.network.Processor)  
kafka.network.InvalidRequestException: Error getting request for apiKey: 3 and apiVersion: 2

错误原因:API不兼容,依赖中kfka客户端的API太新,是0.10.1.0,而服务端的版本较旧,是0.10.0.0,所以Kafka SocketServer就连接不上,被强行关闭了,数据也就没办法写进broker。
解决办法:在pom.xml中降低kafka客户端的依赖版本:
由:

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_${scala.version}</artifactId>
    <version>0.10.1.0</version>
</dependency>

改为:

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_${scala.version}</artifactId>
    <version>0.10.0.1</version>
</dependency>
posted @ 2021-08-25 17:06  mediocrep  阅读(68)  评论(0编辑  收藏  举报
既然选择了远方,便只顾风雨兼程!