Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Highlighted

Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Explorer

Hi community,

 

I'm installing CDH 5.5 on CentOs 6 using the Cloudera Manager.

So far everything works, but formatting the namenode and starting namenode fails with the following error message.

 

Std. error:

 

java.io.IOException: Cannot create directory /dfs/nn/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:148)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:1041)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1479)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1606)
16/03/04 17:55:11 ERROR namenode.NameNode: Failed to start namenode.

std. our:

 

Sat Mar  5 17:03:09 CET 2016
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre
using /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95.x86_64/jre as JAVA_HOME
using 5 as CDH_VERSION
using /var/run/cloudera-scm-agent/process/43-hdfs-NAMENODE-format as CONF_DIR
using  as SECURE_USER
using  as SECURE_GROUP
64
Formatting using clusterid: cluster16

I'm sure it is a problem with authorization for the user cloudera-scm.

I have added the user in the sudo group (using visudo), but still no success.

 

Thanks for any advise.

Cheers

Gerd

7 REPLIES 7
Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

New Contributor

this is serious error across lots of users getting. 

some google tells me  that setting permissions such as following will help, but no official word from cloudera(????)

 

ls -Ald /

ls -Ald /var

ls -Ald /dfs

 

chmod 755 /dfs

chown root:root /dfs should be verified

Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Explorer

Hi,

 

thanks for the reply. I see the main problem in the fact, that the installation is not complete (the formatting of the namenode is a installation step).

Thus: ls: cannot access /dfs: No such file or directory

If there would be a /dfs directory, I would have set the permission manually, but the directory is not there.

 

Cheers

Gerd

Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Explorer

Hi

 

Did you find any solutions for this problem?. I'm having the same problem now. Thank you

 

 

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Contributor

I think you need to check if your hdfs system user (by default it is called hdfs) has permission to create /dfs/nn/current.

 

 

Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Explorer

Thanks Keagles,

 

In the process of checking user permissions and granting the permission, I lost my ubuntu. So this time I installed both windows and ubuntu operating systems. Now I've been on working on installing cloudera manager VM on windows. Thanks

-Vga

 

Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

New Contributor

Does anyone solved the issue ? I too getting similar problem, even i tried creating the directories manually on root user and gave 755 permission. But didnt solved the problem. Also tried changing the owner to cloudera-scm, Even it didnt solved the issue. I am setting up cluster in single user mode. 

 

  

Highlighted

Re: Formatting namenode failed: java.io.IOException: Cannot create directory /dfs/nn/current

Contributor

Which user are you running the installer with? You don't have to create the complete directory structure manually as the installer will automatically create those; just create the top level directory/filesystem.

Don't have an account?
Coming from Hortonworks? Activate your account here