简体   繁体   English

字数 C++ Hadoop 管道不起作用

[英]Wordcount C++ Hadoop pipes does not work

I am trying to run the example of wordcount in C++ like this link describes the way to do: Running the WordCount program in C++ .我正在尝试在 C++ 中运行 wordcount 的示例,就像这个链接描述的方法一样: Running the WordCount program in C++ The compilation works fine, but when I tried to run my program, an error appeared:编译工作正常,但是当我尝试运行我的程序时,出现了错误:

bin/hadoop pipes -conf../dev/word.xml -input testtile.txt -output wordcount-out bin/hadoop 管道 -conf../dev/word.xml -input testtile.txt -output wordcount-out
11/06/06 14:23:40 WARN mapred.JobClient: No job jar file set. 2006 年 11 月 6 日 14:23:40 警告 mapred.JobClient:没有作业 jar 文件集。 User classes may not be用户类可能不是
found.成立。 See JobConf(Class) or JobConf#setJar(String).请参阅 JobConf(Class) 或 JobConf#setJar(String)。
11/06/06 14:23:40 INFO mapred.FileInputFormat: Total input paths to process: 1 11/06/06 14:23:40 INFO mapred.FileInputFormat:要处理的总输入路径:1
11/06/06 14:23:40 INFO mapred.JobClient: Running job: job_201106061207_0007 2006 年 11 月 6 日 14:23:40 信息 mapred.JobClient:正在运行的作业:job_201106061207_0007
11/06/06 14:23:41 INFO mapred.JobClient: map 0% reduce 0% 2006 年 11 月 6 日 14:23:41 信息 mapred.JobClient: map 0% 减少 0%
11/06/06 14:23:53 INFO mapred.JobClient: Task Id: attempt_201106061207_0007_m_000000_0, Status: FAILED 2006 年 11 月 6 日 14:23:53 信息 mapred.JobClient:任务 ID:尝试_201106061207_0007_m_000000_0,状态:失败
java.io.IOException java.io.IOException
at org.apache.hadoop.mapred.pipes.OutputHandler.waitForAuthentication(OutputHandler.java:188) at org.apache.hadoop.mapred.pipes.Application.waitForAuthentication(Application.java:194) at org.apache.hadoop.mapred.pipes.Application.(Application.java:149) at org.apache.hadoop.mapred.pipes.PipesMapRunner.run(PipesMapRunner.java:68) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:435) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:371) at org.ZB6EFD606D118D0F62066E at org.apache.hadoop.mapred.pipes.OutputHandler.waitForAuthentication(OutputHandler.java:188) at org.apache.hadoop.mapred.pipes.Application.waitForAuthentication(Application.java:194) at org.apache.hadoop.mapred .pipes.Application.(Application.java:149) at org.apache.hadoop.mapred.pipes.PipesMapRunner.run(PipesMapRunner.java:68) at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java: 435) at org.apache.hadoop.mapred.MapTask.run(MapTask.Z93F725A07423FE1C889F448B33D21F466Z:3071) at org. 31419FF04CCZ.hadoop.mapred.Child$4.run(Child.java:259) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:416) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059) at org.apache.hadoop.mapred.Child.main(Child.java:253) 31419FF04CCZ.hadoop.mapred.Child$4.run(Child.java:259) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:416) at org.apache .hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059) at org.apache.hadoop.mapred.Child.main(Child.java:253)
attempt_201106061207_0007_m_000000_0: Server failed to authenticate.尝试_201106061207_0007_m_000000_0:服务器无法进行身份验证。 Exiting退出

I am running Hadoop on Fedora on two nodes, and I followed instructions for configurations from that link: Running Hadoop on multi-node cluster .我在两个节点上的 Fedora 上运行 Hadoop,我按照该链接的配置说明进行操作: Running Hadoop on multi-node cluster I tried the wordcount example of Hadoop with that command:我使用该命令尝试了 Hadoop 的字数示例:

bin/hadoop jar hadoop-examples-0.20.203.0.jar wordcount testtile.txt wordcount-out bin/hadoop jar hadoop-examples-0.20.203.0.jar wordcount testtile.txt wordcount-out

And that command works fine.该命令工作正常。 That is why I don't understand why my program did not work.这就是为什么我不明白为什么我的程序不起作用。 So I hope that someone have an idea about what I am doing wrong, or if someone had already resolve this error.所以我希望有人知道我做错了什么,或者是否有人已经解决了这个错误。

I do not know if I have to answer to my question in this way, or edit my question.我不知道我是否必须以这种方式回答我的问题,或者编辑我的问题。 Anyway I find the solution and I just want to tell it for everyone who will get the same error.无论如何,我找到了解决方案,我只想告诉每个会遇到同样错误的人。

After few days of research and try, I understand that Fedora and C++ on 64bits for Hadoop is not a good match.经过几天的研究和尝试,我了解到 Fedora 和 Hadoop 的 64 位上的 C++ 不是很好的匹配。 I tried to compile the Hadoop wordcount C++ with ant like explained in the wiki.我尝试使用 ant 编译 Hadoop 字数 C++,如 wiki 中所述。 But ant gets me some error about: libssl and stdint.但是 ant 给我一些关于:libssl 和 stdint 的错误。

First, if you are on Fedora you have to add -lcrypto to the LIBS variables in the .configure .首先,如果您使用 Fedora,则必须将-lcrypto添加到.configure中的LIBS变量中。 That is cause the dependency on libcrypto must now be explicitely stated on these platform when linking to libssl.(see bug on Fedora ).这是因为当链接到 libssl 时,现在必须在这些平台上明确说明对 libcrypto 的依赖。(参见Fedora 上的错误)。

Second issue: ant produces a lot of error about C++ files: to resolve that you just have to add an include: stdint.h on the top of the file.第二个问题:ant 产生很多关于 C++ 文件的错误:要解决您只需在文件顶部添加一个 include: stdint.h的问题。

Then the build success.然后构建成功。 I tried then to run wordcount example on my Hadoop cluster and it works, while mine did not.然后我尝试在我的 Hadoop 集群上运行 wordcount 示例,它可以工作,而我的没有。 I expected that issue come from the library that I just corrected and I was right: I tried to run Hadoop example with library from the hadoop install directory and it did not work and I get the same error.我预计该问题来自我刚刚更正的库,我是对的:我尝试使用 hadoop 安装目录中的库运行 Hadoop 示例,但它不起作用,我得到了同样的错误。

That could be explained by the fact that ant recompile the C++ library needed for Hadoop(with correction that I did) and used it, instead library provides in the Hadoop install directory.这可以通过以下事实来解释:ant 重新编译了 Hadoop 所需的 C++ 库(我做了更正)并使用了它,而不是库在 Hadoop 安装目录中提供。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM