Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Namenode safe mode

avatar
Super Collaborator

During maintenance of Cluster, we put Namenode into Safemode.

How to identify if Namenode is in safemode. I mean is there a command which tells us if Namenode is in safemode. Or what are the characteristics that determine Namenode is under Safe mode

1 ACCEPTED SOLUTION

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
Master Guru

Run hadoop dfsadmin -safemode get

[LAKE] [xxx@lake1 ~]# hadoop dfsadmin -safemode get
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.


Safe mode is OFF in xx.xx.xx.com/1xxxx5:8020
Safe mode is OFF in xx.xx.xx.com/1xxx:8020
[LAKE] [xxx@lake1 ~]#


avatar

As per the documentation:

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.0-Win/bk_HDP_Install_Win/content/ref-d4ba8d91...

Safemode: Safemode is a state where no changes can be made to the blocks. HDFS cluster is in safemode state during start up because the cluster needs to validate all the blocks and their locations. Once validated, safemode is then disabled.

The options for safemode command are:

hdfs dfsadmin -safemode [enter | leave | get]

Please see the following commands:

root@mycluster:~# su - hdfs
hdfs@mycluster:~$ hdfs dfsadmin -safemode enter
Safe mode is ON
hdfs@mycluster:~$ hdfs dfsadmin -safemode get
Safe mode is ON
hdfs@mycluster:~$ hdfs dfsadmin -safemode leave
Safe mode is OFF
hdfs@mycluster:~$

avatar
Expert Contributor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login