您好,

图片看不到,可以把图片上传到第三方网站,然后贴个链接,或者贴一下文本的报错信息。


> 在 2020年4月9日,下午4:41,秦寒 <[email protected]> 写道:
> 
> 您好
>        根据你们的说明我做了如下配置,我用的是flink 1.10版本
> 1在pyflink/lib下面添加了kafka-clients-2.2.0.jar
> 
>  
> 2 在build-target/lib下面添加了flink-sql-connector-kafka_2.11-1.10.0.jar  
> flink-connector-kafka_2.11-1.10.0.jar 以及 flink-json-1.10.0-sql-jar.jar
> 
>  
> 3 构建PyFlink发布包并安装
> cd flink-python; python setup.py sdist 
> pip install dist/*.tar.gz
>  
>  
> 4 执行测试程序tumble_window.py报错如下,不知道你们有没有遇见过这个错误,望能解答
> [yy1s@rbtnode1 project]$ python3 tumble_window.py
> 
> 
>  
>  
>  
> 发件人: Hequn Cheng <[email protected]> 
> 发送时间: 2020年4月9日 10:08
> 收件人: user-zh <[email protected]>
> 抄送: [email protected]
> 主题: Re: 关于kafka connector通过python链接
>  
> Hi 秦寒,
>  
> Dian 说得很完善了。除此之外,金竹的博客[1]有介绍“Python API 中如何使用 Kafka”,可能对你有帮助,可以看下。
>  
> Best, Hequn
>  
> [1] 
> https://enjoyment.cool/2019/08/28/Apache%20Flink%20%E8%AF%B4%E9%81%93%E7%B3%BB%E5%88%97-%20Python%20API%20%E4%B8%AD%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Kafka/
>  
> <https://enjoyment.cool/2019/08/28/Apache%20Flink%20%E8%AF%B4%E9%81%93%E7%B3%BB%E5%88%97-%20Python%20API%20%E4%B8%AD%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20Kafka/>
>  
> On Thu, Apr 9, 2020 at 9:34 AM Dian Fu <[email protected] 
> <mailto:[email protected]>> wrote:
>> 你指的是Python Table API中如何使用kafka connector的例子吗?这个是有例子的[1]。
>> 
>> 关于如何把kafka client的jar包配置到Python环境,分两种情况,当前有对应的两种解决方案:
>> 1)如果是local运行,需要把kafka client的jar拷贝到python环境中pyflink的lib目录下
>> 2)如果是remote运行,可以通过CLI的-j选项添加。
>> 
>> 这两种方式对于Python用户来说可能都不太便捷,所以已有一个JIRA[3]在考虑添加另外一种对Python用户来说更友好的方式,欢迎到JIRA里参与讨论。
>> 
>> [1] 
>> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector
>>  
>> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector><https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector
>>  
>> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/connect.html#kafka-connector>>
>> [2] 
>> https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html 
>> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html> 
>> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html 
>> <https://ci.apache.org/projects/flink/flink-docs-release-1.10/ops/cli.html>>
>> [3] https://issues.apache.org/jira/browse/FLINK-16943 
>> <https://issues.apache.org/jira/browse/FLINK-16943> 
>> <https://issues.apache.org/jira/browse/FLINK-16943 
>> <https://issues.apache.org/jira/browse/FLINK-16943>>
>> > 在 2020年4月9日,上午8:45,zhisheng <[email protected] 
>> > <mailto:[email protected]>> 写道:
>> > 
>> > hi, 秦寒
>> > 
>> > 暂时还没有 Python 这块的 API,可以去社区 JIRA 提建议
>> > 
>> > Best
>> > 
>> > zhisheng
>> > 
>> > 秦寒 <[email protected] <mailto:[email protected]>> 于2020年4月8日周三 
>> > 下午4:10写道:
>> > 
>> >> 您好
>> >> 
>> >>       Flink的 kafka connector 文档中只有java 和scala的列子,能否添加python
>> >> 调用kafka的列子,包括如何添加kafka connector,kafka client的jar包配置到pyhon
>> >> 环境等,谢谢。
>> >> 
>> >> 
>> >> 
>> >> 
>> 

回复