Hadoop is not showing my job in the job tracker even though it is running

前端 未结 2 1298
灰色年华
灰色年华 2020-12-10 15:03

Problem: When I submit a job to my hadoop 2.2.0 cluster it doesn\'t show up in the job tracker but the job completes successfully. By this

2条回答
  •  时光说笑
    2020-12-10 15:54

    The resolution to the issue was to configure the job with the extra configuration options for yarn. I made int incorrect assumption that the java hadoop-client api would use the configuration options from the configuration directory. I was able to diagnose the problem by turning on verbose logging using log4j.properties for my unit tests. It showed that the jobs were running local and not being submitted to the yarn resource manager. With a little bit of trial and error I was able to configure the job and have it submitted to the yarn resource manager.

    Code

        try {
            configuration.set("fs.defaultFS", "hdfs://127.0.0.1:9000");
            configuration.set("mapreduce.jobtracker.address", "localhost:54311");
            configuration.set("mapreduce.framework.name", "yarn");
            configuration.set("yarn.resourcemanager.address", "localhost:8032");
    
            Job job = createJob(configuration);
            job.waitForCompletion(true);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Unable to execute job", e);
        }
    

提交回复
热议问题