Support Questions

Find answers, ask questions, and share your expertise

Failed to format Namenode

avatar
Explorer

I got CM up and running and want to add the HDFS service. Keep getting this error. In fact I went to the linux disk and in desperation made chmod -R 755 to the root namenode folder. Still get this error

 

java.io.IOException: Cannot create directory /media/sanjay/hdd02/dfs/nn/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:416)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:173)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1169)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1610)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1720)
2022-12-30 11:51:27,073 ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
java.io.IOException: Cannot create directory /media/sanjay/hdd02/dfs/nn/current
at org.apache.hadoop.hdfs.server.common.Storage$StorageDirectory.clearDirectory(Storage.java:416)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:579)
at org.apache.hadoop.hdfs.server.namenode.NNStorage.format(NNStorage.java:601)
at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:173)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1169)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1610)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1720)
2022-12-30 11:51:27,074 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1: java.io.IOException: Cannot create directory /media/sanjay/hdd02/dfs/nn/current
2022-12-30 11:51:27,076 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at hp8300one/10.0.0.3
************************************************************/

1 ACCEPTED SOLUTION

avatar
Explorer

OK I solved it. Basically the permissions to the following datanode drives on all my three machines had to be made "sudo chown -R  hdfs:hadoop"

 

/media/sanjay/hdd02

/media/sanjay/hdd02

 

 

View solution in original post

1 REPLY 1

avatar
Explorer

OK I solved it. Basically the permissions to the following datanode drives on all my three machines had to be made "sudo chown -R  hdfs:hadoop"

 

/media/sanjay/hdd02

/media/sanjay/hdd02