一次hive reduce oom 处理:Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTas

问题: hive job失败,现象reduce失败,起了新的reduc而后还是失败,最终job失败
错误:
2017-06-07 16:43:20 INFO Examining task ID: task_*** (and more) from job job_***
2017-06-07 16:43:21 INFO FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
去jobhistory看log,发现map都成功了 reduce失败,查看日志发现是oom了
2017-06-07 15:31:27,557 FATAL [main] org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.OutOfMemoryError: Java heap space
2017-06-07 15:31:01,929 FATAL [main] org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.OutOfMemoryError: GC overhead limit exceeded

解决办法:
1、调大reduce内存,限制每个reduce处理的数据量
set mapreduce.reduce.memory.mb=16384;
set mapreduce.reduce.java.opts=-Xmx16384m;
set hive.exec.reducers.bytes.per.reducer = 100000000;
这时reduce数变多了,但是还是失败
2 、直接加大reduce数到2000,成功
set mapred.reduce.tasks = 2000;
set mapreduce.reduce.memory.mb=16384;
set mapreduce.reduce.java.opts=-Xmx16384m;

你可能感兴趣的:(Hive)