Hadoop集群运行wordcount jar包出错
出错提示
[xiaoqiu@s151 /home/xiaoqiu]$ hadoop jar HDFSTest.jar com.cr.hdfs.wordcount1.wordcountAPP hdfs: //s150/usr/xiaoqiu/wordcount hdfs://s150/usr/xiaoqiu/wordcount/output
Exception in thread "main" java.lang.ClassNotFoundException: com.cr.hdfs.wordcount1.wordcountAP P
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
错误写法:
hadoop jar HDFSTest.jar com.cr.hdfs.wordcount1.wordcountAPP hdfs: //s150/usr/xiaoqiu/wordcount hdfs://s150/usr/xiaoqiu/wordcount/output
正确写法:
[xiaoqiu@s151 /home/xiaoqiu]$ hadoop jar HDFSTest.jar com.cr.hdfs.wordcount1 hdfs://s150/user/xiaoqiu/wordcount/wc.txt hdfs://s150/user/xiaoqiu/wordcount/output
这里我去掉了jobname :wordcountApp
欢迎关注我的公众号:小秋的博客
CSDN博客:https://blog.csdn.net/xiaoqiu_cr
github:https://github.com/crr121
联系邮箱:rongchen633@gmail.com
有什么问题可以给我留言噢~