I ran namenode -format.This is my output. I tried changing the file permissions chmod 777 hadoop.
I believe this line is the error ERROR namenode.NameNode: java.io.IOException: Cannot create directory /your/path/to/hadoop/tmp/dir/hadoop-hadoop/dfs/name/current
adoop@alexander-desktop:/usr/local/hadoop/bin$ ./hadoop namenode -format
12/07/03 17:03:56 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = alexander-desktop/127.0.1.1
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
************************************************************/
12/07/03 17:03:56 INFO namenode.FSNamesystem: fsOwner=hadoop,hadoop
12/07/03 17:03:56 INFO namenode.FSNamesystem: supergroup=supergroup
12/07/03 17:03:56 INFO namenode.FSNamesystem: isPermissionEnabled=true
12/07/03 17:03:56 ERROR namenode.NameNode: java.io.IOException: Cannot create directory /your/path/to/hadoop/tmp/dir/hadoop-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)
12/07/03 17:03:56 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at alexander-desktop/127.0.1.1
hadoop@alexander-desktop:/usr/local$ sudo hadoop/bin/hadoop namenode -format
sudo: /etc/sudoers is mode 0777, should be 0440
sudo: no valid sudoers sources found, quitting
try with sudo (I realize you changed permissions) but I would still try sudo and check if that resolves the problem.
Following steps resolved my problem -
1- sudo su
Enter your password.
2-/usr/local/hadoop/bin/hdfs namenode -format.
This has been done for hadoop2.5 in which "hadoop namenode -format" has beendeprecated hence using "hdfs namenode -format"
Check hdfs-site.xml configuration, it may has a wrong path for properties dfs.namenode.name.dir and dfs.datanode.data.dir In my case it was the cause of the problem (directory was situated in other then current user's home folder).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With