hadoop异常 java.io.IOException: Job status not available

来源:互联网 发布:unity3d vr手游 编辑:程序博客网 时间:2024/05/19 16:21

原文地址:http://blog.csdn.net/u011098327/article/details/53939875


Hadoop集群上跑mapreduce,在job任务执行完成退出时报 java.io.IOException: Job status not available异常。Job client请求job状态时,Application Master已经完成转而去Job history server请求job状态,就在这里抛出异常

[plain] view plain copy
  1. [xubc@master conf]$ hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount /user/lizeyi/people.txt  /user/lizeyi/wordcount7  
  2. 15/06/08 18:36:16 INFO client.RMProxy: Connecting to ResourceManager at master.hadoop/10.3.4.35:8032  
  3. 15/06/08 18:36:17 INFO input.FileInputFormat: Total input paths to process : 1  
  4. 15/06/08 18:36:17 INFO lzo.GPLNativeCodeLoader: Loaded native gpl library  
  5. 15/06/08 18:36:17 INFO lzo.LzoCodec: Successfully loaded & initialized native-lzo library [hadoop-lzo rev 39cf0c71a251a79c50555810ca660450d9682140]  
  6. 15/06/08 18:36:17 INFO mapreduce.JobSubmitter: number of splits:1  
  7. 15/06/08 18:36:18 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1433756996622_0004  
  8. 15/06/08 18:36:18 INFO impl.YarnClientImpl: Submitted application application_1433756996622_0004  
  9. 15/06/08 18:36:18 INFO mapreduce.Job: The url to track the job: http://master.hadoop:8088/proxy/application_1433756996622_0004/  
  10. 15/06/08 18:36:18 INFO mapreduce.Job: Running job: job_1433756996622_0004  
  11. 15/06/08 18:36:40 INFO mapred.ClientServiceDelegate: Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server  
  12. java.io.IOException: Job status not available   
  13.         at org.apache.hadoop.mapreduce.Job.updateStatus(Job.java:322)  
  14.         at org.apache.hadoop.mapreduce.Job.isComplete(Job.java:609)  
  15.         at org.apache.hadoop.mapreduce.Job.monitorAndPrintJob(Job.java:1354)  
  16.         at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1316)  
  17.         at org.apache.hadoop.examples.WordCount.main(WordCount.java:87)  
  18.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  19.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
  20.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
  21.         at java.lang.reflect.Method.invoke(Method.java:606)  
  22.         at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)  
  23.         at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:145)  
  24.         at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)  
  25.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  26.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
  27.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
  28.         at java.lang.reflect.Method.invoke(Method.java:606)  
  29.         at org.apache.hadoop.util.RunJar.main(RunJar.java:212)  

须配置Job History Server相关参数,让Job Client可以读取job最后的执行状态,测试Hadoop版本2.5.0

添加参数vim mapred-site.xml

[html] view plain copy
  1.  <property>  
  2.    <name>mapreduce.jobhistory.address</name>  
  3.    <value>master.hadoop:10020</value>  
  4. </property>  
  5. <property>  
  6.    <name>yarn.app.mapreduce.am.staging-dir</name>  
  7.    <value>/tmp/hadoop-yarn/staging</value>  
  8. </property>  
  9. <property>  
  10.    <name>mapreduce.jobhistory.intermediate-done-dir</name>  
  11.    <value>${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate</value>  
  12. </property>  
  13. <property>  
  14.    <name>mapreduce.jobhistory.done-dir</name>  
  15.    <value>${yarn.app.mapreduce.am.staging-dir}/history/done</value>  
  16. </property>  

修改完成配置后,重新执行任务后正常退出

[plain] view plain copy
  1. [xubc@master conf]$ hadoop jar /usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount /user/lizeyi/people.txt  /user/lizeyi/wordcount9  
  2. 15/06/08 18:54:04 INFO client.RMProxy: Connecting to ResourceManager at master.hadoop/10.3.4.35:8032  
  3. 15/06/08 18:54:06 INFO input.FileInputFormat: Total input paths to process : 1  
  4. 15/06/08 18:54:06 INFO lzo.GPLNativeCodeLoader: Loaded native gpl library  
  5. 15/06/08 18:54:06 INFO lzo.LzoCodec: Successfully loaded & initialized native-lzo library [hadoop-lzo rev 39cf0c71a251a79c50555810ca660450d9682140]  
  6. 15/06/08 18:54:06 INFO mapreduce.JobSubmitter: number of splits:1  
  7. 15/06/08 18:54:06 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1433760669916_0001  
  8. 15/06/08 18:54:07 INFO impl.YarnClientImpl: Submitted application application_1433760669916_0001  
  9. 15/06/08 18:54:07 INFO mapreduce.Job: The url to track the job: http://master.hadoop:8088/proxy/application_1433760669916_0001/  
  10. 15/06/08 18:54:07 INFO mapreduce.Job: Running job: job_1433760669916_0001  
  11. 15/06/08 18:54:34 INFO mapred.ClientServiceDelegate: Application state is completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job history server  
  12. 15/06/08 18:54:35 INFO mapreduce.Job: Job job_1433760669916_0001 running in uber mode : false  
  13. 15/06/08 18:54:35 INFO mapreduce.Job:  map 100% reduce 100%  
  14. 15/06/08 18:54:35 INFO mapreduce.Job: Job job_1433760669916_0001 completed successfully  
  15. 15/06/08 18:54:35 INFO mapreduce.Job: Counters: 49  
  16.         File System Counters  
  17.                 FILE: Number of bytes read=68  
  18.                 FILE: Number of bytes written=205241  
  19.                 FILE: Number of read operations=0  
  20.                 FILE: Number of large read operations=0  
  21.                 FILE: Number of write operations=0  
  22.                 HDFS: Number of bytes read=151  
  23.                 HDFS: Number of bytes written=46  
  24.                 HDFS: Number of read operations=6  
  25.                 HDFS: Number of large read operations=0  
  26.                 HDFS: Number of write operations=2  
  27.         Job Counters   
  28.                 Launched map tasks=1  
  29.                 Launched reduce tasks=1  
  30.                 Data-local map tasks=1  
  31.                 Total time spent by all maps in occupied slots (ms)=6036  
  32.                 Total time spent by all reduces in occupied slots (ms)=6132  
  33.                 Total time spent by all map tasks (ms)=6036  
  34.                 Total time spent by all reduce tasks (ms)=6132  
  35.                 Total vcore-seconds taken by all map tasks=6036  
  36.                 Total vcore-seconds taken by all reduce tasks=6132  
  37.                 Total megabyte-seconds taken by all map tasks=6180864  
  38.                 Total megabyte-seconds taken by all reduce tasks=6279168  
  39.         Map-Reduce Framework  
  40.                 Map input records=4  
  41.                 Map output records=4  
  42.                 Map output bytes=54  
  43.                 Map output materialized bytes=68  
  44.                 Input split bytes=113  
  45.                 Combine input records=4  
  46.                 Combine output records=4  
  47.                 Reduce input groups=4  
  48.                 Reduce shuffle bytes=68  
  49.                 Reduce input records=4  
  50.                 Reduce output records=4  
  51.                 Spilled Records=8  
  52.                 Shuffled Maps =1  
  53.                 Failed Shuffles=0  
  54.                 Merged Map outputs=1  
  55.                 GC time elapsed (ms)=82  
  56.                 CPU time spent (ms)=2150  
  57.                 Physical memory (bytes) snapshot=447897600  
  58.                 Virtual memory (bytes) snapshot=1986359296  
  59.                 Total committed heap usage (bytes)=355467264  
  60.         Shuffle Errors  
  61.                 BAD_ID=0  
  62.                 CONNECTION=0  
  63.                 IO_ERROR=0  
  64.                 WRONG_LENGTH=0  
  65.                 WRONG_MAP=0  
  66.                 WRONG_REDUCE=0  
  67.         File Input Format Counters   
  68.                 Bytes Read=38  
  69.         File Output Format Counters   
  70.                 Bytes Written=46  

参考文章:https://support.pivotal.io/hc/en-us/articles/201180246-IOException-Job-status-not-available-when-mapreduce-job-exits-successfully

    http://stackoverflow.com/questions/23182642/yarn-in-aazon-ec2-with-whirr


阅读全文
0 0