When I try to format NameNode on Hadoop, I get an error saying that the directories can't be created.
Cannot create directory /usr/local/hadoop_store/hdfs/namenode/current
Cannot create directory /usr/local/hadoop_store/hdfs/namenode/current
java.io.IOException: Cannot create directory /usr/local/hadoop_store/hdfs/namenode/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:337)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:548)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:569)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:161)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:990)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1428)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1553)
15/06/06 22:04:30 ERROR namenode.NameNode: Failed to start namenode.
java.io.IOException: Cannot create directory /usr/local/hadoop_store/hdfs/namenode/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:337)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:548)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:569)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:161)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:990)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1428)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1553)
This error occurs if you have not created the /usr/local/hadoop_store/hdfs/namenode
folder or it does not have correct permission.
Create the directory first. Try this in terminal:
sudo mkdir /usr/local/hadoop_store/hdfs/namenode
NOTE: Run this command as hadoop user.
Change permissions, if necessary.
sudo chown -R hadoopuser:hadoopgroup /usr/local/hadoop_store/hdfs/namenode
sudo chmod -R 777 /usr/local/hadoop_store/hdfs/namenode
Here, hadoopuser
is your hadoop username and hadoopgroup
is hadoop group name.
Which OS are you using on your hadoop cluster??
If you're running this on Ubuntu try this..
sudo bin/hadoop namenode -format
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