hive在运行hql语句时报如下错误:
Error: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=2)
原因:Hadoop内存不足导致
解决方法:
在Hadoop的配置文件Hadoop-env.sh中修改如下配置:
原来为
export HADOOP_CLIENT_OPTS="-Xmx128m $HADOOP_CLIENT_OPTS"
修改为:
export HADOOP_CLIENT_OPTS="-Xmx2048m $HADOOP_CLIENT_OPTS"
然后重启Hadoop即可