日志没有出现在控制台中:( [Hadoop 问题]

发布于 2024-10-07 05:11:45 字数 277 浏览 0 评论 0原文

我正在尝试调试 Cloudera Hadoop 的 WordCount 示例,但我不能。我已经记录了映射器和减速器类,但在控制台中没有出现日志。

我附上图像。 在第一张图片中,Java 日志。

在第二个图像中,记录结果。看来不是第一个:( http://i56.tinypic.com/2eztkli.png

有人知道吗?多谢!!

I am trying to debug the WordCount example of Cloudera Hadoop but I can't. I've logged the mapper and the reducer class, but in the console doesn't appear the log.

I attach the images.
In first image, the Java logs.

In the second imagen, the result logs. It doesn't appear the first one :(
http://i56.tinypic.com/2eztkli.png

Anyone knows?? Thanks a lot!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绮烟 2024-10-14 05:11:45

您正在执行“hadoop jar ...”,因此您将使用实际的 Hadoop 集群(可能是单节点)开始您的工作。

这意味着所有日志记录都是由集群完成的,而不是在控制台上完成的。
您在控制台上看到的本质上只是一个进度指示器。

您的工作分为一项或多项映射任务和一项或多项归约任务。这些任务中的每一个都是一个单独的 java 进程,并且将具有单独的日志记录(由多个文件组成)。

您应该在 $HADOOP_LOG_DIR/userlogs 中找到这些日志文件,

因为很多事情都是并行完成的,您不希望这些日志文件成为“一个”巨大的日志文件。它会变成一团无用的烂摊子。

现在,对于学习和开发 hadoop 应用程序,有一个更简单的方法:只需将应用程序作为普通 Java 应用程序启动即可在本地模式下运行应用程序:java -jar ...

You are doing "hadoop jar ..." so you are starting your job using an actual Hadoop cluster (perhaps single node).

This means that all logging is done by the cluster and not on the console.
What you see on the console is essentially only a progress indicator.

Your job is split into one or more map tasks and one or more reduce tasks. Each of those tasks is a separate java process and will have individual logging ( which consists of several files).

You should find those logfiles in $HADOOP_LOG_DIR/userlogs

Because a lot of things are done in parallel you do no want these logfiles to be 'one' huge logfile. It would become a useless mess.

Now for learning and developing hadoop applications there is an easier way out: Simply run your application in local mode by simply starting it as a normal Java app: java -jar ...

苦行僧 2024-10-14 05:11:45

哦,这是一个简单的修复。使用System.out.println(),然后查看jobtracker的HTML界面。转到已完成 Map 或 Reduce 的任务,其中包含 println,然后如果继续查看该任务的日志报告,您将发现那里打印出输出。

Oh it's a simple fix. Use System.out.println() and then look on the HTML interface of the jobtracker. Go to the task that has done Map or Reduce, which one contains the println, and then if you go on to the log report for that task, you'll find your outputs printed out there.

美人如玉 2024-10-14 05:11:45

如果您想在控制台中显示信息,请执行 System.out.println("blah");在你的 Java 作业中,它工作得很好,尤其是在传递参数(例如,如果参数错误时的用法)以及在 jar 中执行不止一项作业等时。筛选 Hadoop 日志很乏味,如果你正在做真正的工作。

If you want to show information in the console then do System.out.println("blah"); in your Java jobs, it works well especially when passing arguments (e.g. usage if arguments are wrong) and doing more than just 1 single job in your jar, etc. Sifting through the Hadoop logs is tedious best to just punt to the console if you are doing real work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文