The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

MapReduce Forum

Unable to submit mapreduce job to Yarn via java client

  • #51837
    Leslie
    Participant

    Hi All,
    I’m trying to submit a mapreduce job from a java client running on Windows7 to the Hortonworks Sandbox.

    Driver code:
    public static void main(String[] args) throws Exception
    {
    UserGroupInformation ugi = UserGroupInformation.createRemoteUser(“jackie_leslie”);
    ugi.doAs(new PrivilegedExceptionAction<Object>() {
    String[] jobArgs;
    @Override
    public Object run() throws Exception {
    JobWrapper mr = new JobWrapper();
    int exitCode = ToolRunner.run(mr, jobArgs);
    System.exit(exitCode);
    return mr;
    }

    private PrivilegedExceptionAction init(String[] myArgs)
    {
    this.jobArgs = myArgs;
    return this;
    }
    }.init(args)
    );
    }

    Mapper class

    @Override
    public int run(String[] args) throws Exception
    {
    Configuration config = getConf();
    config.set(“fs.defaultFS”, “hdfs://sandbox.hortonworks.com:8020”);
    config.set(“mapreduce.framework.name”, “yarn”);
    config.set(“yarn.resourcemanager.address”, “localhost:8050”); //8025 or 8032?
    config.set(“hadoop.job.ugi”, “jackie_leslie”);

    @SuppressWarnings(“deprecation”)
    Job job = new Job(config);
    job.setJobName(“upload”);
    job.setJarByClass(MyKVMapper.class);
    job.setMapperClass(MyKVMapper.class);
    job.setMapOutputKeyClass(ImmutableBytesWritable.class);
    job.setInputFormatClass(TextInputFormat.class);
    FileInputFormat.addInputPath(job, new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1]));
    boolean success = job.waitForCompletion(true);

    client stacktrace
    Exception in thread “main” org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /tmp/hadoop-yarn/staging/jackie_leslie/.staging/job_1397842310782_0004/job.split could only be replicated to 0 nodes instead of minReplication (=1). There are 1 datanode(s) running and 1 node(s) are excluded in this operation.
    at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1384)
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2503)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:555)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:387)
    at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java:59582) etc.

    Also from the logs.
    2014-04-18 13:59:25,603 WARN security.UserGroupInformation (UserGroupInformation.java:getGroupNames(1355)) – No groups available for user jackie_leslie

    Why is this job not being submitted to my data node?

    Thanks.

  • Author
    Replies
  • #52609
    Koelli Mungee
    Moderator

    Hi Jackie

    Can you verify that the datanodes are up and check the output of “hadoop dfsadmin -report” to ensure that the HDFS is healthy. Are you able to put files into the HDFS from the command line?

    Thanks
    Koelli

The forum ‘MapReduce’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.