NullPointerException at org.apache.hadoop.mapred.TaskTracker.getMapRHostname while running pig in local mode.

Document created by rsingh on Feb 13, 2016
Version 1Show Document
  • View in full screen mode

Author: Rajkumar Singh

 

Original Publication Date: May 3, 2015

 

Env:

M3

 

Symptom:

Pig is working fine in Mapreduce mode but throwing following exceptions while running in local mode:

WARN org.apache.hadoop.mapred.LocalJobRunner - job_local_0001

java.lang.ExceptionInInitializerError

  at org.apache.hadoop.mapred.CentralTaskLogUtil.(CentralTaskLogUtil.java:62)

  at org.apache.hadoop.mapred.TaskStatus.(TaskStatus.java:100)

  at org.apache.hadoop.mapred.MapTaskStatus.(MapTaskStatus.java:29)

  at org.apache.hadoop.mapred.TaskStatus.createTaskStatus(TaskStatus.java:479)

  at org.apache.hadoop.mapred.Task.(Task.java:194)

  at org.apache.hadoop.mapred.MapTask.(MapTask.java:117)

  at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:193)

Caused by: java.lang.NullPointerException

  at org.apache.hadoop.mapred.TaskTracker.getMapRHostname(TaskTracker.java:2770)

  at org.apache.hadoop.mapred.TaskTracker.initializeHostname(TaskTracker.java:1168)

  at org.apache.hadoop.mapred.TaskTracker.(TaskTracker.java:220)

  ... 7 more

2013-07-12 13:44:21,594 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - HadoopJobId: job_local_0001

2013-07-12 13:44:21,669 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment:zookeeper.version=3.3.6--1, built on 09/07/2012 18:16 GMT

2013-07-12 13:44:21,670 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment:host.name=dev-xyz.com

2013-07-12 13:44:21,670 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.version=1.6.0_38

2013-07-12 13:44:21,670 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.vendor=Sun Microsystems Inc.

2013-07-12 13:44:21,670 [main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.home=/usr/java/jdk1.6.0_38/jre

Root Cause:

Pig job is unable to find the MapRHostname and throwing NullPointerException, which causes the job to fail.

 

Solution:

Check whether file /opt/mapr/hostname is there or not and also check the permission over it.

if unable to find the hostname file then run the following command to create one.

hostname -f > /opt/mapr/hostname

Attachments

    Outcomes