【魔镜】同步任务报错:Container exited with a non-zero exit code 143.

技术总结 yangchenhui 18582℃ 0评论

现象

魔镜同步表失败,失败堆栈主要信息如下:

ExecutorLostFailure (executor 25 exited caused by one of the running tasks) Reason: Container marked as failed: container_e31_1578203509259_0004_01_000042 on host: bigdata4. Exit status: 143. Diagnostics: [2020-01-11 13:43:09.306]Container killed on request. Exit code is 143
[2020-01-11 13:43:09.306]Container exited with a non-zero exit code 143. 
[2020-01-11 13:43:09.311]Killed by external signal

问题根本原因

spark资源有限,为了充分利用资源,我们将每个executor的资源设置的很小,增加了并行度,但是遇到数据量很大的全量同步,会知道单个executor内存溢出,产生143错误。

问题解决思路

利用数据开发->表管理->同步高级设置功能,增加同步的并行度。

注意点

  1. 选择合适的并行度字段。尽量使每个分区字段不超过50万行数据。
    select count(1) ,MONTH(from_unixtime(CreateTime/1000)) as m from OrderInfo group by MONTH(from_unixtime(CreateTime/1000))
  2. 这里选择并行字段是mysql的语法,不是spark语法。所以date_format(from_unixtime(CreateTime/1000,'yyyyMMdd'),'yyyy-MM')应改为 date_format(from_unixtime(CreateTime/1000),'%Y%m')
  3. 大表尽量增加day,month这种字段,并且增加相应索引,函数虽然也能用,但是mysql不会走索引,性能会非常差。

本文固定链接:杨晨辉的个人博客 » 【魔镜】同步任务报错:Container exited with a non-zero exit code 143.
本站内容除特别标注外均为原创,欢迎转载,但请保留出处!

喜欢 (4)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址