Why doesn't the Flink SocketTextStreamWordCount work?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 15:48:12

问题


I've set up the example project and built it. I'm able to run the WordCount program as expected. But when I run the SocketTextWordCount, I'm not getting any results printed out.

  • I send data in through nc (localhost:9999 on both sides)
  • In the web console for the running job, I can see that there are messages being sent/received

But I never see the counts.print() output printed out anywhere, even after killing the nc session.

EDIT - when I change it around to print results to a text file, no problem. So the issue seems to be that counts.print() isn't properly writing to the stdout of the console I'm running the example in.


回答1:


DataStreams are printed to the standard-out of the TaskManager process. When starting a Flink instance (local or cluster), the standard-out of a TaskManager is directed into an .out file in the ./log/ directory of the Flink root directory. So you should check if the output is written into these files.

This behavior is different from DataSet.print(), where the results are collected on the JobManager, shipped to the client, and printed by the client.



来源:https://stackoverflow.com/questions/37264697/why-doesnt-the-flink-sockettextstreamwordcount-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!