【问题标题】:How to restart Map Reduce Hadoop job using Spring Batch Yarn Application?如何使用 Spring Batch Yarn Application 重新启动 Map Reduce Hadoop 作业?
【发布时间】:2016-10-06 19:34:00
【问题描述】:

我有 Map Reduce 应用程序,我想使用 Spring Batch Yarn 逻辑。 就像下面链接中提到的那样。

https://spring.io/guides/gs/yarn-batch-restart/

但我希望它像通常我们在 hadoop map reduce 作业中那样非常具体。 只是在寻找 Spring Batch Yarn 类和配置。考虑到我的 hadoop map reduce 逻辑已经到位并且可以正常工作。

提前致谢!!

【问题讨论】:

    标签: hadoop mapreduce spring-data spring-batch restart


    【解决方案1】:

    这是您正在寻找的 ApplicationContext 配置

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:hdp="http://www.springframework.org/schema/hadoop" xmlns:batch="http://www.springframework.org/schema/batch"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd
         http://www.springframework.org/schema/context  http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">
    
        <context:property-placeholder location="classpath:application.properties" />
        <hdp:configuration namenode-principal="hdfs://xx.yy.com" rm-manager-uri="xx.yy.com"
            security-method="kerb" user-keytab="location" rm-manager-principal="username"
            user-principal="username">
            fs.default.name=${fs.default.name}
            mapred.job.tracker=${mapred.job.tracker}
        </hdp:configuration>
    
        <hdp:job id="wordCountJobId" input-path="${input.path}"
            output-path="${output.path}" jar-by-class="com.xx.poc.Application"
            mapper="com.xx.poc.Map" reducer="com.xx.poc.Reduce" />
    
        <hdp:job-runner id="wordCountJobRunner" job-ref="wordCountJobId"
            run-at-startup="true" />
    </beans>
    

    【讨论】:

      猜你喜欢
      • 2014-02-20
      • 1970-01-01
      • 2015-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-05
      相关资源
      最近更新 更多