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






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


  at org.apache.hadoop.mapred.CentralTaskLogUtil.(

  at org.apache.hadoop.mapred.TaskStatus.(

  at org.apache.hadoop.mapred.MapTaskStatus.(

  at org.apache.hadoop.mapred.TaskStatus.createTaskStatus(

  at org.apache.hadoop.mapred.Task.(

  at org.apache.hadoop.mapred.MapTask.(

  at org.apache.hadoop.mapred.LocalJobRunner$

Caused by: java.lang.NullPointerException

  at org.apache.hadoop.mapred.TaskTracker.getMapRHostname(

  at org.apache.hadoop.mapred.TaskTracker.initializeHostname(

  at org.apache.hadoop.mapred.TaskTracker.(

  ... 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

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.



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