简体   繁体   English

无法在hadoop中使用内置wordcount jar文件

[英]Unable to use inbuild wordcount jar file in hadoop

I am struggling with the below code. 我正在努力与下面的代码。 can any one help me to sort out. 谁能帮我解决一下。

[cloudera@localhost ~]$ hadoop jar /usr/lib;

Exception in thread "main" java.io.IOException: Error opening job   jar:    /usr/lib
at org.apache.hadoop.util.RunJar.main(RunJar.java:135)
Caused by: java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at org.apache.hadoop.util.RunJar.main(RunJar.java:133)

[cloudera@localhost ~]$ 

I want to run the wordcount example jar in hadoop itself.But its not allowing to use the inbuild jar 我想在hadoop本身中运行wordcount示例jar,但是不允许使用内置jar

Thanks, Anbu k. 谢谢,安布

You need to point to an actual jar. 您需要指向一个实际的罐子。 "/usr/lib" is not a jar file. "/usr/lib"不是一个jar文件。 Refer to this for the commands. 请参阅命令。

Try following command. 尝试执行以下命令。 Assuming, $HADOOP_HOME is declared and you have copied input data to HDFS. 假设已声明$ HADOOP_HOME,并且您已将输入数据复制到HDFS。

$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/hadoop-*-examples.jar wordcount your_input_path your_output_path

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

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