为什么Flink SocketTextStreamWordCount不起作用? [英] Why doesn't the Flink SocketTextStreamWordCount work?

查看:754
本文介绍了为什么Flink SocketTextStreamWordCount不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立了示例项目并构建了它.我能够按预期运行WordCount程序.但是当我运行SocketTextWordCount时,没有得到任何打印结果.

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.

  • 我通过nc发送数据(两侧均为localhost:9999)
  • 在正在运行的作业的Web控制台中,我可以看到有消息正在发送/接收

但是我什至看不到counts.print()输出打印在任何地方,即使杀死了nc会话之后.

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

编辑-当我更改它以将结果打印到文本文件时,没问题.因此,问题似乎在于counts.print()没有正确地写入我正在运行示例的控制台的标准输出中.

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.

推荐答案

DataStream被打印到TaskManager进程的标准输出中.启动Flink实例(本地或群集)时,TaskManager的标准配置将定向到Flink根目录的./log/目录中的.out文件中.因此,您应该检查输出是否已写入这些文件中.

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.

此行为不同于DataSet.print(),后者的结果是在JobManager上收集,运送到客户端并由客户端打印的.

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

这篇关于为什么Flink SocketTextStreamWordCount不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆