核心错误信息:
Error: org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuffle in fetcher#1
at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run(Shuffle.java:134)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:376)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1924)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.io.IOException: Exceeded MAX_FAILED_UNIQUE_FETCHES; bailing-out.
at org.apache.hadoop.mapreduce.task.reduce.ShuffleSchedulerImpl.checkReducerHealth(ShuffleSchedulerImpl.java:392)
at org.apache.hadoop.mapreduce.task.reduce.ShuffleSchedulerImpl.copyFailed(ShuffleSchedulerImpl.java:307)
at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyFromHost(Fetcher.java:366)
at org.apache.hadoop.mapreduce.task.reduce.Fetcher.run(Fetcher.java:198)
......
java.io.FileNotFoundException: File does not exist: hdfs://lee000:8020/user/root/QuasiMonteCarlo_1577894683281_1771433094/out/reduce-out
解决方案:
修改"$HADOOP_HOME/sbin"
目录下"yarn-site.xml"
配置文件,追加"hdfs-site.xml"
中的"hadoop.tmp.dir"
的同名属性,不然yarn会因为找不到缓存文件而报错:
<configuration>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<!--追加部分 开始-->
<property>
<name>hadoop.tmp.dir</name>
<value>/home/jimmy/install/hadoop_tmp</value>
</property>
<!--追加部分 结束-->
</configuration>
修改配置文件后重启hadoop相关服务后测试成功:
./stop-all.sh
./start-all.sh
[root@lee000 mapreduce]# hadoop jar hadoop-mapreduce-examples-2.6.0-cdh5.15.1.jar pi 2 3
Number of Maps = 2
Samples per Map = 3
20/01/01 10:26:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Wrote input for Map #0
Wrote input for Map #1
Starting Job
20/01/01 10:26:35 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
20/01/01 10:26:36 INFO input.FileInputFormat: Total input paths to process : 2
20/01/01 10:26:37 INFO mapreduce.JobSubmitter: number of splits:2
20/01/01 10:26:37 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1577719671945_0004
20/01/01 10:26:37 INFO impl.YarnClientImpl: Submitted application application_1577719671945_0004
20/01/01 10:26:37 INFO mapreduce.Job: The url to track the job: http://lee000:8088/proxy/application_1577719671945_0004/
20/01/01 10:26:37 INFO mapreduce.Job: Running job: job_1577719671945_0004
20/01/01 10:26:45 INFO mapreduce.Job: Job job_1577719671945_0004 running in uber mode : false
20/01/01 10:26:45 INFO mapreduce.Job: map 0% reduce 0%
20/01/01 10:26:54 INFO mapreduce.Job: map 50% reduce 0%
20/01/01 10:26:55 INFO mapreduce.Job: map 100% reduce 0%
20/01/01 10:27:01 INFO mapreduce.Job: map 100% reduce 100%
20/01/01 10:27:01 INFO mapreduce.Job: Job job_1577719671945_0004 completed successfully
20/01/01 10:27:02 INFO mapreduce.Job: Counters: 49
File System Counters
FILE: Number of bytes read=50
FILE: Number of bytes written=430197
FILE: Number of read operations=0
FILE: Number of large read operations=0
FILE: Number of write operations=0
HDFS: Number of bytes read=522
HDFS: Number of bytes written=215
HDFS: Number of read operations=11
HDFS: Number of large read operations=0
HDFS: Number of write operations=3
Job Counters
Launched map tasks=2
Launched reduce tasks=1
Data-local map tasks=2
Total time spent by all maps in occupied slots (ms)=13499
Total time spent by all reduces in occupied slots (ms)=4474
Total time spent by all map tasks (ms)=13499
Total time spent by all reduce tasks (ms)=4474
Total vcore-milliseconds taken by all map tasks=13499
Total vcore-milliseconds taken by all reduce tasks=4474
Total megabyte-milliseconds taken by all map tasks=13822976
Total megabyte-milliseconds taken by all reduce tasks=4581376
Map-Reduce Framework
Map input records=2
Map output records=4
Map output bytes=36
Map output materialized bytes=56
Input split bytes=286
Combine input records=0
Combine output records=0
Reduce input groups=2
Reduce shuffle bytes=56
Reduce input records=4
Reduce output records=0
Spilled Records=8
Shuffled Maps =2
Failed Shuffles=0
Merged Map outputs=2
GC time elapsed (ms)=325
CPU time spent (ms)=2410
Physical memory (bytes) snapshot=655372288
Virtual memory (bytes) snapshot=8317001728
Total committed heap usage (bytes)=520093696
Shuffle Errors
BAD_ID=0
CONNECTION=0
IO_ERROR=0
WRONG_LENGTH=0
WRONG_MAP=0
WRONG_REDUCE=0
File Input Format Counters
Bytes Read=236
File Output Format Counters
Bytes Written=97
Job Finished in 26.243 seconds
Estimated value of Pi is 4.00000000000000000000