[MaxCompute MapReduce实践]通过简单瘦身,解决Dataworks 10M文件限制问题

用户在DataWorks上执行MapReduce作业的时候,文件大于10M的JAR和资源文件不能上传到Dataworks,导致无法使用调度去定期执行MapReduce作业。

解决方案:

第一步:大于10M的resources通过MaxCompute CLI客户端上传,

客户端下载地址:https://help.aliyun.com/document_detail/27971.html

客户端配置AK、EndPoint:https://help.aliyun.com/document_detail/27804.html

add jar C:\test_mr\test_ab.jar -f;//添加资源,大于10M

第二步:目前通过MaxCompute CLI上传的资源,在Dataworks左侧资源列表是找不到的,只能通过list resources查看确认资源;

list resources;//查看资源

第三步:瘦身Jar,因为Dataworks执行MR作业的时候,一定要依赖ClassPath,所以要在Dataworks中注册瘦身Jar(保留main就可以),之后提交到MaxCompute集群,系统会找到刚才客户端CLI注册的大于10M的resources资源;

jar 

-resources test_mr.jar,test_ab.jar 
//resources在客户端注册后直接引用

-classpath test_mr.jar  
//瘦身策略:在gateway上提交要有main和相关的mapper和reducer,
额外的三方依赖可以不需要,其他都可以放到resources

com.aliyun.odps.examples.mr.test_mr wc_in wc_out;


通过上述方法,我们可以在Dataworks上跑大于10M的MR作业。

    原文作者:MapReduce
    原文地址: https://yq.aliyun.com/articles/632511
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞