本人也是一名新手,正在学习星环的大数据产品系列。
敲击hdfs -help,会得到以下结果;
dfs run a filesystem command on the file systems supported in Hadoop.
namenode -format format the DFS filesystem
secondarynamenode run the DFS secondary namenode
namenode run the DFS namenode
journalnode run the DFS journalnode
zkfc run the ZK Failover Controller daemon
datanode run a DFS datanode
dfsadmin run a DFS admin client
haadmin run a DFS HA admin client
fsck run a DFS filesystem checking utility
balancer run a cluster balancing utility
jmxget get JMX exported values from NameNode or DataNode.
oiv apply the offline fsimage viewer to an fsimage
oiv_legacy apply the offline fsimage viewer to an legacy fsimage
oev apply the offline edits viewer to an edits file
fetchdt fetch a delegation token from the NameNode
getconf get config values from configuration
groups get the groups which users belong to
snapshotDiff diff two snapshots of a directory or diff the current directory contents with a snapshot
lsSnapshottableDir list all snapshottable dirs owned by the current userUse -help to see options
portmap run a portmap service
nfs3 run an NFS version 3 gateway
cacheadmin configure the HDFS cache
现在网上比较多的其实是hdfs dfs 下的一些命令,实际内容要多得多。其实以上每个选项都可以单独去看,每个选项下对应若干命令参数,就拿dfsadmin来说吧,它是一个多任务的工具,我们可以使用它来获取HDFS的状态信息,以及在HDFS上执行的一系列管理操作。其参数如下:
-report:查看文件系统的基本信息和统计信息。
-safeadmin enter | leave | get | wait:安全模式命令。
[-report [-live] [-dead] [-decommissioning]]
[-saveNamespace]
[-rollEdits]
[-restoreFailedStorage true|false|check]
[-refreshNodes]:重新读取hosts和exclude文件,使新的节点或需要退出集群的节点能够被NameNode重新识别。这个命令在新增节点或注销节点时用到。
[-setQuota <quota> <dirname>...<dirname>]:为每个目录<dirname>设定配额<quota>。目录配额是一个长整形整数,强制设定目录树下的名字个数。
[-clrQuota <dirname>...<dirname>]:为每个目录<dirname>清除配额设定。
[-setSpaceQuota <quota> <dirname>...<dirname>]
[-clrSpaceQuota <dirname>...<dirname>]
[-finalizeUpgrade]:终结HDFS的升级操作。DataNode删除前一个版本的工作目录,之后NameNode也这样做。
[-rollingUpgrade [<query|prepare|finalize>]]
[-refreshServiceAcl]
[-refreshUserToGroupsMappings]
[-refreshSuperUserGroupsConfiguration]
[-refreshCallQueue]
[-refresh <host:ipc_port> <key> [arg1..argn]
[-printTopology]
[-refreshNamenodes datanodehost:port]
[-deleteBlockPool datanodehost:port blockpoolId [force]]
[-setBalancerBandwidth <bandwidth>]
[-fetchImage <local directory>]
[-allowSnapshot <snapshotDir>]
[-disallowSnapshot <snapshotDir>]
[-shutdownDatanode <datanode_host:ipc_port> [upgrade]]
[-getDatanodeInfo <datanode_host:ipc_port>
-upgradeProgress status | details | force:请求当前系统的升级状态 | 升级状态的细节 | 强制升级操作
而网络上常常出现的,属于hdfs dfs 下的参数,如下: