Easy Glance with Hadoop

Hadoop is a framework for distributed processing large amount of data set across clusters of computers. Hadoop is an open source framework under Apache.

So today I'm not going to show you how to setup hadoop in your machine. You can find some article in here. If you want to setup multi-node cluster here is another article. Also some time back I blogged about how to setup single node hadoop cluster and you can find it here.

When you follow the above tutorials you can simply setup the single node and multi node hadoop cluster. But when I did that I got lots of problems when setting up a multi node cluster (single setup is a straight forward). So in this post I will list down some of issues and also the solutions for that. Also feel free to add any issues that you found as comments.

Before that you need to keep in mind to always check the hadoop logs. After you start the hadoop services or when running map reduce task always check the hadoop logs. To check your job logs, there are two ways you can do it. Either from browser or console. Job logs are created in "hadoop/logs/userlogs/job_id/*".

Here are the issues and solutions for Hadoop multi node cluster

Issue 1 :
  • ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Incompatible namespaceIDs
  • If you got this exception in hadoop namenode log what you need to do is copy the namenode namespace id and paste it in every data node namespace id. (including master data node, if your master also act as datanode)
    • vi ${path/to/hadoop/datastore}dfs/name/current/VERSION
    • Copy namespace id value
    • vi ${path/tp/hadoop/datastore/dfs}data/current/VERSION
    • Paste it as in namespace id
  • ${path/to/hadoop/datastore} --> you can find it in hadoop/conf/core-site.xml

Issue 2:

  • ERROR PriviledgedActionException as:rajith File /home/rajith/softwares/hadoop-temp/mapred/system/ could only be replicated to 0 nodes, instead of 12012-09-14 13:09:50,683 INFO org.apache.hadoop.ipc.Server: IPC Server handler 7 on 54310, call addBlock(/home/rajith/softwares/hadoop-temp/mapred/system/, DFSClient_-632414254, null) from127.0.0.1:42296: error: File /home/rajith/softwares/hadoop-temp/mapred/system/jobtracker.infocould only be replicated to 0 nodes, instead of File /home/rajith/softwares/hadoop-temp/mapred/system/ could only be replicated to 0 nodes, instead of 1at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock( at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(
  • If you got this exception on your hadoop namenode log what you need to is be patient. :)
    • First start the datanode ( and wait until the datanode starts. This may take 2min to start the datanode. You can verify it in logs.
    • After that start the job tracker (
Issue 3:

  • Error reading task outputhttp://localhost:50060/tasklog?plaintext=true&attemptid=attempt_201209141426_0001_m_000002_0&filter=stdout12/09/14 14:27:41 WARN mapred.JobClient: Error reading task outputhttp://localhost:50060/tasklog?plaintext=true&attemptid=attempt_201209141426_0001_m_000002_0&filter=stder
  • If you got this error that means you need to remove  localhost map in /etc/hosts in slave machine.
  • Restart your hadoop nodes and check the logs.
Issue 4:
  • java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(

  • If you got the above exception in datanode check the max number of process by using the following command
    • ulimit -u
      • If you got 1024 or around something increase the value to get rid of that error
    • To increase add following lines to your /etc/security/limit.conf
      • * soft nproc 8094
      • * hard nproc 8094
    • Restart machine to take effect

1 comment:

  1. hi i have installed hadoop with single nodecluster. it installed correct when i try to run the mapreduce prg in hadoop cloudera example Pi 10,10 , it gives error
    org.apache.hadoop.ipc.RemoteException: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/ssmadhu/PiEstimator_TMP_3_141592654/in. Name node is in safe mode.
    The reported blocks 49 has reached the threshold 0.9990 of total blocks 49. Safe mode will be turned off automatically in 3 seconds.
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(
    t sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.apache.hadoop.util.RunJar.main(