分享

【解决】hadoop 运行自己写的wordcount下例子报错:error opening job jar

本帖最后由 howtodown 于 2014-4-11 02:22 编辑


报错如下:

[root@hadoop hadoop]# hadoop jar mapreduce.jar com.wordCount.WordCount /usr/hello/hello.txt /usr/hello/count.txt14/02/21 23:35:01 INFO mapred.JobClient: Cleaning up the staging area hdfs://hadoop:9000/usr/local/hadoop/tmp/mapred/staging/root/.staging/job_201402211715_0002
14/02/21 23:35:01 ERROR security.UserGroupInformation: PriviledgedActionException as:root cause:org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /usr/hello/count.txt already exists
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /usr/hello/count.txt already exists
at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:137)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:949)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:912)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:912)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at com.wordCount.WordCount.main(WordCount.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
[root@hadoop hadoop]# hadoop jar mapreduce.jar com.wordCount.WordCount /usr/hello/hello.txt /usr/hello/count.txt
14/02/21 23:36:33 INFO mapred.JobClient: Cleaning up the staging area hdfs://hadoop:9000/usr/local/hadoop/tmp/mapred/staging/root/.staging/job_201402211715_0003
14/02/21 23:36:33 ERROR security.UserGroupInformation: PriviledgedActionException as:root cause:org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /usr/hello/count.txt already exists
Exception in thread "main" org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /usr/hello/count.txt already exists
at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:137)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:949)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:912)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:912)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at com.wordCount.WordCount.main(WordCount.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)


[root@hadoop hadoop]# hadoop fs -ls /usr/hello
Found 3 items
drwxr-xr-x - root supergroup 0 2014-02-21 23:25 /usr/hello/count.txt
-rw-r--r-- 1 root supergroup 18 2014-02-21 22:59 /usr/hello/hello.txt
-rw-r--r-- 1 root supergroup 3468 2014-02-21 23:16 /usr/hello/mapreduce.jar


[root@hadoop hadoop]# hadoop fs -rmr /usr/hello/count.txt
Deleted hdfs://hadoop:9000/usr/hello/count.txt
[root@hadoop hadoop]# hadoop fs -ls /usr/hello
Found 2 items
-rw-r--r-- 1 root supergroup 18 2014-02-21 22:59 /usr/hello/hello.txt
-rw-r--r-- 1 root supergroup 3468 2014-02-21 23:16 /usr/hello/mapreduce.jar


运行失败:
[root@hadoop hadoop]# hadoop jar mapreduce.jar com.wordCount.WordCount /usr/hello/hello.txt /usr/hello/count.txt
14/02/21 23:38:10 INFO input.FileInputFormat: Total input paths to process : 1
14/02/21 23:38:10 INFO util.NativeCodeLoader: Loaded the native-hadoop library
14/02/21 23:38:10 WARN snappy.LoadSnappy: Snappy native library not loaded
14/02/21 23:38:11 INFO mapred.JobClient: Running job: job_201402211715_0004
14/02/21 23:38:12 INFO mapred.JobClient: map 0% reduce 0%
14/02/21 23:38:21 INFO mapred.JobClient: map 50% reduce 0%
14/02/21 23:42:26 INFO mapred.JobClient: Task Id : attempt_201402211715_0004_m_000000_0, Status : FAILED


已有(4)人评论

跳转到指定楼层
pig2 发表于 2014-4-11 02:17:33
把你输出目录中的文件删掉就可以啦
回复

使用道具 举报

howtodown 发表于 2014-4-11 02:19:25
解决了其中一个问题,但是又遇到一个错误
error.png
error opening job jar
回复

使用道具 举报

pig2 发表于 2014-4-11 02:20:58
看看是不是路径问题 或者是本地和linux环境中JDK版本不一样
回复

使用道具 举报

howtodown 发表于 2014-4-11 02:21:42
版本是不一样
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条