Database Reference
In-Depth Information
When you are starting a newly formatted HDFS cluster, the namenode does not go into
safe mode, since there are no blocks in the system.
Table 11-1. Safe mode properties
Property name
Type
Default
value
Description
1
The minimum number of replicas that
have to be written for a write to be suc-
cessful.
dfs.namenode.replication.min
int
float 0.999 The proportion of blocks in the system that
must meet the minimum replication level
defined by
dfs.namenode.replication.min be-
fore the namenode will exit safe mode.
Setting this value to 0 or less forces the na-
menode not to start in safe mode. Setting
this value to more than 1 means the na-
menode never exits safe mode.
dfs.namenode.safemode.threshold-
pct
30000 The time, in milliseconds, to extend safe
mode after the minimum replication condi-
tion defined by
dfs.namenode.safemode.threshold-
pct has been satisfied. For small clusters
(tens of nodes), it can be set to 0.
dfs.namenode.safemode.extension int
Entering and leaving safe mode
To see whether the namenode is in safe mode, you can use the dfsadmin command:
% hdfs dfsadmin -safemode get
Safe mode is ON
The front page of the HDFS web UI provides another indication of whether the namenode
is in safe mode.
Sometimes you want to wait for the namenode to exit safe mode before carrying out a
command, particularly in scripts. The wait option achieves this:
% hdfs dfsadmin -safemode wait
# command to read or write a file
An administrator has the ability to make the namenode enter or leave safe mode at any
time. It is sometimes necessary to do this when carrying out maintenance on the cluster or
Search WWH ::




Custom Search