Ubuntu – Error when formatting the Hadoop filesystem

hadoopsoftware installation

I'm using the following sites to install and configure Hadoop in Ubuntu 10.10
http://arifn.web.id/blog/2010/07/29/running-hadoop-single-cluster.html

However, when I try to format the Hadoop file-system, I get the following errors.

amathew@amathew-Dimension-3000:~$ cd /usr/local/hadoop
amathew@amathew-Dimension-3000:/usr/local/hadoop$ bin/hadoop namenode -format
11/04/16 21:23:07 INFO namenode.NameNode: STARTUP_MSG: 
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = amathew-Dimension-3000/192.168.1.66
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 0.20.2
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
************************************************************/
11/04/16 21:23:08 INFO namenode.FSNamesystem: fsOwner=amathew,amathew,adm,dialout,cdrom,plugdev,lpadmin,admin,sambashare
11/04/16 21:23:08 INFO namenode.FSNamesystem: supergroup=supergroup
11/04/16 21:23:08 INFO namenode.FSNamesystem: isPermissionEnabled=true
11/04/16 21:23:08 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /usr/local/hadoop-datastore/hadoop/dfs/name/current
    at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:295)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1086)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:1110)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:856)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:948)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:965)

11/04/16 21:23:08 INFO namenode.NameNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at amathew-Dimension-3000/192.168.1.66
************************************************************/

Can anyone help with these error messages, namely ERROR namenode.NameNode: java.io.IOException: Cannot create directory /usr/local/hadoop-datastore/hadoop/dfs/name/current.

$ sudo mkdir /usr/local/hadoop/datastore
$ sudo chown  hadoop:hadoop /usr/local/hadoop/datastore
$ sudo chmod 750 /usr/local/hadoop/datastore

Best Answer

  • Hadoop cannot create /usr/local/hadoop-datastore/hadoop/dfs/name/current directory.

    Try running this:

    sudo bin/hadoop namenode -format
    

    Running Hadoop executable using sudo.I'm not sure, but I think it didn't work for me when I installed Hadoop. If so do this:

    sudo su
    

    then:

    bin/hadoop namenode -format
    
  • Related Question