Skip to main content
Justee
Silver ⭐️⭐️⭐️
June 20, 2021
Question

HDFS Cannot Create the directory of the user

I installed hadoop-2.7.1 on a centos7 operating system.
when I execute the command # hdfs dfs -mkdir /user/Juste . I get an error

 

[hdfs@MASTER ~]$ hdfs dfs -mkdir /user/Juste
21/06/20 11:04:04 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
mkdir: `/user/Juste': No such file or directory

14 replies

ChethanYM
Gold ⭐️
Gold ⭐️
June 20, 2021

Hi,

Hadoop has native implementations of certain components for both performance and non-availability of Java implementations. These components are available in a single, dynamically-linked native Linux library called the native hadoop library. On the *nix platforms the library is named libhadoop.so.

It is just a Warning but not an error and it can be ignored.

 

Please check if you have an issue with other hdfs commands as well...and check the hdfs logs and see if you can get exact errors.

 

 

Translate
Justee
JusteeAuthor
Silver ⭐️⭐️⭐️
June 20, 2021

When I execute this command this is the output

[hdfs@MASTER ~]$ hdfs dfs -mkdir /user
21/06/20 13:51:54 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
mkdir: Cannot create directory /user. Name node is in safe mode

Translate
ChethanYM
Gold ⭐️
Gold ⭐️
June 20, 2021

Safemode in Hadoop is a maintenance state of NameNode, during which NameNode doesn’t allow any modifications to the file system.

can you use below command to come out of the safemode and try to create a directory?

 

## hadoop dfsadmin -safemode leave

## hdfs dfs -mkdir /user/justee

Translate