Name node is in safe mode Not able to leave

0 votes
root# bin/hadoop fs -mkdir t
mkdir: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/root/t. Name node is in safe mode.

not able to create anything in hdfs

I did

root# bin/hadoop fs -safemode leave

But showing

safemode: Unknown command

what is the problem?

Dec 7, 2020 in Big Data Hadoop by Roshni
• 10,520 points
1,721 views

1 answer to this question.

0 votes

In order to forcefully let the namenode leave safemode, following command should be executed:

 bin/hadoop dfsadmin -safemode leave

You are getting Unknown command error for your command as -safemode isn't a sub-command for hadoop fs, but it is of hadoop dfsadmin.

Also after the above command, I would suggest you to once run hadoop fsck so that any inconsistencies crept in the hdfs might be sorted out.

Update:

Use hdfs command instead of hadoop command for newer distributions. The hadoop command is being deprecated:

hdfs dfsadmin -safemode leave

hadoop dfsadmin has been deprecated and so is hadoop fs command, all hdfs related tasks are being moved to a separate command hdfs

answered Dec 7, 2020 by Gitika
• 65,910 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to exit name node from safe mode?

In order to forcefully let the namenode ...READ MORE

answered Sep 26, 2018 in Big Data Hadoop by slayer
• 29,350 points
1,712 views
0 votes
1 answer

Not able to start Job History Server in Hadoop 2.8.1

You have to start JobHistoryServer process specifically ...READ MORE

answered Mar 30, 2018 in Big Data Hadoop by Ashish
• 2,650 points
2,315 views
0 votes
2 answers

Hadoop is not able to find jps command

jps is actually not a command of ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by Shubham
• 13,490 points
13,973 views
0 votes
1 answer

NodeManager is not able to connect to the ResourceManager.

Here, I guess the issue is with ...READ MORE

answered May 1, 2018 in Big Data Hadoop by Shubham
• 13,490 points
3,416 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,558 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
104,213 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
4,260 views
0 votes
1 answer
0 votes
1 answer

I have installed Hadoop on Ubuntu but name node is not running.

If you are using Hadoop version-2.7.7, then ...READ MORE

answered Apr 30, 2019 in Big Data Hadoop by Gitika
• 65,910 points
1,579 views
0 votes
1 answer

How to check the directory is present in shell script or not?

Hi, To check the directory is present in ...READ MORE

answered Jun 25, 2019 in Big Data Hadoop by Gitika
• 65,910 points
498 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP