国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

在hive插入數(shù)據(jù)時出現(xiàn)“Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask”報錯

這篇具有很好參考價值的文章主要介紹了在hive插入數(shù)據(jù)時出現(xiàn)“Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask”報錯。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

一.問題重現(xiàn)

SQL 錯誤 [2] [08S01]: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

在hive插入數(shù)據(jù)時出現(xiàn)“Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask”報錯,hadoop,hive,apache

二.問題分析

這個錯誤代碼表明 Hive 作業(yè)由于某種原因失敗。

? ?1.資源問題: 這個錯誤可能發(fā)生在集群上存在資源約束的情況下,例如內(nèi)存或 CPU 資源不足以完成 Hive 作業(yè)。

? ?2.數(shù)據(jù)問題: 它可能與數(shù)據(jù)本身相關。例如,數(shù)據(jù)可能損壞,或者數(shù)據(jù)格式或模式存在問題,Hive 無法處理。

? ?3.配置問題: 不正確的 Hive 或 Hadoop 配置設置可能導致作業(yè)失敗。

? ?4.查詢錯誤: 可能是與你嘗試執(zhí)行的 SQL 查詢相關的問題。例如,它可能存在語法錯誤,或者嘗試執(zhí)行 Hive 不支持的操作。

? ?5.權限問題: 你可能沒有執(zhí)行你嘗試執(zhí)行的操作所需的權限。

? ?6.版本沖突:hive和Hadoop版本不兼容。

三.問題解決

為了解決這個問題我們可以嘗試以下步驟:

  1. 檢查 Hive 日志以獲取有關問題性質(zhì)的更多詳細錯誤消息。這些日志可以提供有關問題的額外信息。

  2. 檢查你的 SQL 查詢,確保它是正確的,并適用于你正在處理的數(shù)據(jù)和模式。

  3. 驗證你是否具有訪問和操作數(shù)據(jù)所需的權限。

  4. 確保你的 Hive 和 Hadoop 配置正確設置。

  5. 如果錯誤與數(shù)據(jù)有關,請檢查數(shù)據(jù)是否存在問題,如損壞、缺失值或不正確的格式。

  6. 考慮咨詢你的 Hadoop 或 Hive 管理員以獲取進一步的故障排除幫助。
  7. 檢查集群的資源利用情況,看集群資源是否充足。例如CPU和內(nèi)存

? ? ? ? 如果確定是集群資源不足,可以在hadoop/etc/hadoop/yarn-site.sh配置文件添加以下內(nèi)容

 <!--yarn單個容器允許分配的最大最小內(nèi)存 -->
    <property>
        <name>yarn.scheduler.minimum-allocation-mb</name>
        <value>512</value>
    </property>
    <property>
        <name>yarn.scheduler.maximum-allocation-mb</name>
        <value>4096</value>
    </property>
    
    <!-- yarn容器允許管理的物理內(nèi)存大小 -->
    <property>
        <name>yarn.nodemanager.resource.memory-mb</name>
        <value>4096</value>
    </property>
    
    <!-- 關閉yarn對物理內(nèi)存和虛擬內(nèi)存的限制檢查 -->
    <property>
        <name>yarn.nodemanager.pmem-check-enabled</name>
        <value>true</value>
    </property>
    <property>
        <name>yarn.nodemanager.vmem-check-enabled</name>
        <value>false</value>
    </property>

排除以上問題之后問題沒有解決,如果你插入數(shù)據(jù)是很多字段,可以嘗試減少字段插入數(shù)據(jù)

例如

? ? 這是我原本插入的數(shù)據(jù)的SQL語句

-- 插入數(shù)據(jù)
insert overwrite table dw_didi.t_user_order_wide partition(dt='2020-04-12')
select
    orderid,telephone,lng,lat,province,city,es_money,gender,profession,age_range,tip,subscribe,
    case when subscribe = 0 then '非預約'
         when subscribe = 1 then '預約'
    end as subscribe_name,sub_time,is_agent,
    case when is_agent = 0 then '本人'
         when is_agent = 1 then '代叫'
    end as is_agent_name,
    agent_telephone,
    date_format(concat(order_time,':00'),'yyyy-MM-dd') as order_date,
    year(date_format(concat(order_time,':00'),'yyyy-MM-dd:ss')) as order_year,
    month(date_format(concat(order_time,':00'),'yyyy-MM-dd:ss'))as order_month,
    day(date_format(concat(order_time,':00'),'yyyy-MM-dd:ss'))as order_day,
    hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss'))as order_hour,
    case when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 1 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 5 then '凌晨'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 5 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 8 then '早上'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 8 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 11 then '上午'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 11 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 13 then '中午'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 13 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 17 then '下午'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 17 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 19 then '晚上'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 19 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 20 then '半夜'
         when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 20 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 24 then '深夜'
          when hour(date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) > 0 and hour (date_format(concat(order_time,':00'),'yyyy-MM-dd HH:mm:ss')) <= 1 then '深夜'
          else 'N/A'
    end as order_time_range,
    date_format(concat(concat(order_time,':00'),':00'),'yyyy-MM-dd HH:mm:ss') as order_time 
from ods_didi.t_user_order WHERE dt = '2020-04-12' and length(order_time) > 8;
    
    SELECT  * from dw_didi.t_user_order_wide

現(xiàn)在改為

insert overwrite table dw_didi.wide1  partition(dt='2020-04-12')
select
    orderid
from ods_didi.t_user_order WHERE dt = '2020-04-12' and length(order_time) > 8;
    
SELECT  * from dw_didi.wide1

如果嘗試運行之后還是報相同錯誤

就可以基本判定是hive配置文件的錯誤

檢查配置文件后,如果還是報錯,我們可以嘗試設置hive的執(zhí)行引擎

1.下載tez的依賴包:http://tez.apache.org

2.拷貝apache-tez-0.9.1-bin.tar.gz到hadoop102的/export/software目錄

3.解壓縮apache-tez-0.9.1-bin.tar.gz

tar -zxvf apache-tez-0.9.1-bin.tar.gz -C /export/servers

4.進入到Hive的配置目錄

/hive/conf

5.在hive-env.sh文件中添加tez環(huán)境變量配置和依賴包環(huán)境變量配置

vim hive-env.sh
export TEZ_HOME=/export/servers/tez-0.9.1    #是你的tez的解壓目錄
export TEZ_JARS=""
for jar in `ls $TEZ_HOME |grep jar`; do
    export TEZ_JARS=$TEZ_JARS:$TEZ_HOME/$jar
done
for jar in `ls $TEZ_HOME/lib`; do
    export TEZ_JARS=$TEZ_JARS:$TEZ_HOME/lib/$jar
done

export HIVE_AUX_JARS_PATH=/export/servers/hadoop-2.7.7/share/hadoop/common/hadoop-lzo-0.4.20.jar$TEZ_JARS

6.在hive-site.xml文件中添加如下配置,更改hive計算引擎

<property>
    <name>hive.execution.engine</name>
    <value>tez</value>
</property>

7.在Hive的/export/servers/hive/conf下面創(chuàng)建一個tez-site.xml文件

<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
 <configuration>
 <property>
	<name>tez.lib.uris</name>    <value>${fs.defaultFS}/tez/tez-0.9.1,${fs.defaultFS}/tez/tez-0.9.1/lib</value>
</property>
<property>
	<name>tez.lib.uris.classpath</name>    	<value>${fs.defaultFS}/tez/tez-0.9.1,${fs.defaultFS}/tez/tez-0.9.1/lib</value>
</property>
<property>
     <name>tez.use.cluster.hadoop-libs</name>
     <value>true</value>
</property>
<property>
     <name>tez.history.logging.service.class</name>        <value>org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService</value>
</property>
</configuration>

8.將/export/servers/tez-0.9.1上傳到HDFS的/tez路徑

hadoop fs -mkdir /tez
 hadoop fs -put /export/servers/tez-0.9.1/ /tez
 hadoop fs -ls /tez查看結果是這個
 /tez/tez-0.9.1

運行Tez時檢查到用過多內(nèi)存而被NodeManager殺死進程問題:

Caused by: org.apache.tez.dag.api.SessionNotRunning: TezSession has already shutdown. Application application_1546781144082_0005 failed 2 times due to AM Container for appattempt_1546781144082_0005_000002 exited with  exitCode: -103
For more detailed output, check application tracking page:http://hadoop102:8088/cluster/app/application_1546781144082_0005Then, click on links to logs of each attempt.
Diagnostics: Container [pid=11116,containerID=container_1546781144082_0005_02_000001] is running beyond virtual memory limits. Current usage: 216.3 MB of 1 GB physical memory used; 2.6 GB of 2.1 GB virtual memory used. Killing container.

解決方法:文章來源地址http://www.zghlxwxcb.cn/news/detail-753482.html

<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>

到了這里,關于在hive插入數(shù)據(jù)時出現(xiàn)“Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask”報錯的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • 【Hive】Hive在調(diào)用執(zhí)行MapReduce進程時報錯:FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.

    【Hive】Hive在調(diào)用執(zhí)行MapReduce進程時報錯:FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.

    今天,在測試Hive時,碰到了以下錯誤: 從報錯的內(nèi)容上看,應該是調(diào)用MapReduce時出現(xiàn)了錯誤。 盡管查看日志,也沒有明確的指出出現(xiàn)錯誤的原因: 于是,我便想到了用Hadoop來執(zhí)行MapReduce來測試MapReduce的功能是否正常: 執(zhí)行以上命令,發(fā)現(xiàn)調(diào)用MapReduce時確實出現(xiàn)了問題: 根

    2024年02月03日
    瀏覽(31)
  • 已解決:FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask

    今天在跑hive sql的時候,報錯;FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask【從hive log找到的錯誤提示】,詳細的報錯如下所示:時隔近一年,又遇到這個報錯了,蠻無語的,看不出啥原因?qū)е碌摹??!?在網(wǎng)上查了蠻久的,找到一個解決方案 【參考方案】

    2024年02月13日
    瀏覽(20)
  • Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Spark job faile

    Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Spark job faile

    hive on spark 錯誤Error while processing statement: FAILED: Execution Error, return code 3 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Spark job failed during runtime. Please check stacktrace for the root cause. 表明Spark任務執(zhí)行失敗,返回了錯誤代碼3。這可能是由于多種原因?qū)е碌?,例如?nèi)存不足、JSON數(shù)據(jù)格式錯

    2024年04月11日
    瀏覽(40)
  • IDEA 運行hql 出現(xiàn)FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTas

    啟用的hiveserver2 的模擬用戶功能 ,依賴于Hadoop 提供的proxy user(代理用戶功能),只有Hadoop中的代理用戶才能模擬其他用戶身份訪問 Hadoop集群。 因此,需要將hiverserver2 的啟動用戶設置為 Hadoop 的代理用戶 修改hadoop 配置文件 core-site.xml 添加如下配置 重啟Hadoop 以及Hive 再次運

    2024年02月11日
    瀏覽(26)
  • hive插入動態(tài)分區(qū)數(shù)據(jù)時,return code 2報錯解決

    目錄 一、完整報錯 二、原因 ? ? ? ? 2.1、動態(tài)分區(qū)問題 ? ? ? ? 2.2、語句占用內(nèi)存問題 三、其他 一、完整報錯 ????????Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask 二、原因 ? ? ? ? 2.1、動態(tài)分區(qū)問題 ????????大概

    2024年02月08日
    瀏覽(29)
  • hive 報錯return code 40000 from org.apache.hadoop.hive.ql.exec.MoveTask解決思路

    hive 報錯return code 40000 from org.apache.hadoop.hive.ql.exec.MoveTask解決思路

    參考學習 https://github.com/apache/hive/blob/2b57dd27ad61e552f93817ac69313066af6562d9/ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java#L47 為啥學習error code 開發(fā)過程中遇到以下錯誤,大家覺得應該怎么辦?從哪方面入手呢? 1.百度? 2.源碼查看報錯地方 3.忽略(這個錯是偶發(fā)的) 但是這個錯是hive的錯,

    2024年02月03日
    瀏覽(116)
  • 【Hive-Exception】return code 1 from org.apache.hadoop.hive.ql.exec.DDLTaskHIVE

    解決方案: 如果不能設置值,會報錯。 Error: Error while processing statement: Cannot modify hive.msck.path.validation at runtime. It is not in list of params that are allowed to be modified at runtime (state=42000,code=1) 在hive-site中添加內(nèi)容:

    2024年02月09日
    瀏覽(26)
  • return code 3 from org.apache.hadoop.hive.ql.exec.spark.SparkTask.

    return code 3 from org.apache.hadoop.hive.ql.exec.spark.SparkTask.

    集群環(huán)境 錯誤由來 錯誤原因 錯誤分析 解決辦法 1、集群環(huán)境 CDH集群5.16.1 ,hive的引擎是spark。 2、錯誤由來 今天在生產(chǎn)環(huán)境的集群里跑hive任務,報錯 Job failed with org.apache.spark.SparkException: Job aborted due to stage failure: Task 7 in stage 14.0 failed 4 times, most recent failure: Lost task 7.3 in sta

    2024年02月16日
    瀏覽(23)
  • [hive]return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. GC overhead limit exceeded

    [2022-11-10 10:21:31] [08S01][-101] Error while processing statement: FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. GC overhead limit exceeded 一般map讀取一個片的數(shù)據(jù)不會內(nèi)存不夠,所以: 1、調(diào)大reduce個數(shù) 2、group by 數(shù)據(jù)傾斜 3、使用大的隊列

    2024年02月12日
    瀏覽(47)
  • hive on spark hql 插入數(shù)據(jù)報錯 Failed to create Spark client for Spark session Error code 30041

    hive on spark hql 插入數(shù)據(jù)報錯 Failed to create Spark client for Spark session Error code 30041

    離線數(shù)倉 hive on spark 模式,hive 客戶端 sql 插入數(shù)據(jù)報錯 Failed to execute spark task, with exception \\\'org.apache.hadoop.hive.ql.metadata.HiveException(Failed to create Spark client for Spark session 50cec71c-2636-4d99-8de2-a580ae3f1c58)\\\' FAILED: Execution Error, return code 30041 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Failed t

    2024年02月14日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包