Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10991

'hadoop namenode -format' fails if user hadoop homedir is not under /home

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5.0
    • Fix Version/s: None
    • Component/s: fs
    • Labels:
    • Environment:

      CentOS 6.5

      Description

      Since my homedir is on shared NFS, I couldn't create a user for hadoop on /home. Therefore, I've used:
      useradd hadoop --home /hadoop

      which worked well. I've adjusted HADOOP_HOME and friends to match correctly. Running hdfs namenode -format failed:

      14/08/21 13:57:35 INFO namenode.NNConf: XAttrs enabled? true
      14/08/21 13:57:35 INFO namenode.NNConf: Maximum size of an xattr: 16384
      14/08/21 13:57:35 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1696511243-10.103.234.197-1408618655940
      14/08/21 13:57:35 WARN namenode.NameNode: Encountered exception during format: 
      java.io.IOException: Cannot create directory /home/hadoop/hadoopdata/hdfs/namenode/current
      	at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:334)
      	at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
      	at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
      	at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:926)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1354)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1473)
      14/08/21 13:57:35 FATAL namenode.NameNode: Exception in namenode join
      java.io.IOException: Cannot create directory /home/hadoop/hadoopdata/hdfs/namenode/current
      	at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:334)
      	at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:546)
      	at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:567)
      	at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:148)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:926)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1354)
      	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1473)
      14/08/21 13:57:35 INFO util.ExitUtil: Exiting with status 1
      14/08/21 13:57:35 INFO namenode.NameNode: SHUTDOWN_MSG: 
      /************************************************************
      SHUTDOWN_MSG: Shutting down NameNode at lgdrm432.xiodrm.lab.emc.com/10.103.234.197
      

      The error seems to be clear:

      java.io.IOException: Cannot create directory /home/hadoop/hadoopdata/hdfs/namenode/current
      

        Activity

        Hide
        mykaul Yaniv Kaul added a comment -

        Agree - mea culpa - configuration issue - indeed etc/hdfs-site.xml was incorrectly set. Fixing it solved the problem - thanks!

        Show
        mykaul Yaniv Kaul added a comment - Agree - mea culpa - configuration issue - indeed etc/hdfs-site.xml was incorrectly set. Fixing it solved the problem - thanks!
        Hide
        aw Allen Wittenauer added a comment -

        This is either:

        a) permissions issue in /home/hadoop
        b) misconfiguration in hdfs-site.xml

        I've run namenode format in many many directories, including /home and not /home.

        It should be noted that changing HADOOP_PREFIX has zero influence on where the NN fsimage gets created.

        Closing as cannot reproduce.

        Show
        aw Allen Wittenauer added a comment - This is either: a) permissions issue in /home/hadoop b) misconfiguration in hdfs-site.xml I've run namenode format in many many directories, including /home and not /home. It should be noted that changing HADOOP_PREFIX has zero influence on where the NN fsimage gets created. Closing as cannot reproduce.

          People

          • Assignee:
            Unassigned
            Reporter:
            mykaul Yaniv Kaul
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development