Created 03-14-2017 12:11 AM
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
Created 03-14-2017 10:00 AM
To check Namenode Safe mode status, Login to Namenode host and issue the below command,
[user@NNhost1 ~]$ hdfs dfsadmin -safemode get Safe mode is OFF in NNhost1/10.X.X.X:8020 Safe mode is OFF in NNhost2/10.X.X.X:8020 If Safe mode is turned ON, please issue the below command to leave from safemode. [user@NNhost1 ~]$ hdfs dfsadmin -safemode leave
Created 03-14-2017 12:14 AM
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 ~]#
Created 03-14-2017 06:27 AM
As per the documentation:
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:~$
Created 03-14-2017 10:00 AM
To check Namenode Safe mode status, Login to Namenode host and issue the below command,
[user@NNhost1 ~]$ hdfs dfsadmin -safemode get Safe mode is OFF in NNhost1/10.X.X.X:8020 Safe mode is OFF in NNhost2/10.X.X.X:8020 If Safe mode is turned ON, please issue the below command to leave from safemode. [user@NNhost1 ~]$ hdfs dfsadmin -safemode leave