Database Reference
In-Depth Information
after upgrading a cluster, to confirm that data is still readable. To enter safe mode, use the
following command:
% hdfs dfsadmin -safemode enter
Safe mode is ON
You can use this command when the namenode is still in safe mode while starting up to
ensure that it never leaves safe mode. Another way of making sure that the namenode
stays in safe mode indefinitely is to set the property dfs.namenode.safe-
mode.threshold-pct to a value over 1.
You can make the namenode leave safe mode by using the following:
% hdfs dfsadmin -safemode leave
Safe mode is OFF
Audit Logging
HDFS can log all filesystem access requests, a feature that some organizations require for
auditing purposes. Audit logging is implemented using log4j logging at the INFO level. In
the default configuration it is disabled, but it's easy to enable by adding the following line
to hadoop-env.sh :
export HDFS_AUDIT_LOGGER="INFO,RFAAUDIT"
A log line is written to the audit log ( hdfs-audit.log ) for every HDFS event. Here's an ex-
ample for a list status request on /user/tom :
2014-09-30 21:35:30,484 INFO FSNamesystem.audit: allowed=true
ugi=tom
(auth:SIMPLE) ip=/127.0.0.1 cmd=listStatus src=/user/tom
dst=null
perm=null proto=rpc
Tools
dfsadmin
The dfsadmin tool is a multipurpose tool for finding information about the state of HDFS,
as well as for performing administration operations on HDFS. It is invoked as hdfs df-
sadmin and requires superuser privileges.
Some of the available commands to dfsadmin are described in Table 11-2 . Use the -help
command to get more information.
Search WWH ::




Custom Search