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

查看:31
本文介绍了为什么 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 发送数据(本地主机: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.

推荐答案

DataStreams 被打印到 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天全站免登陆