1.HDFS命令通过bin/hdfs执行,语法如下:
| COMMAND_OPTION | Description |
|---|---|
| --config confdir | Overwrites the default Configuration directory. Default is $HADOOP_HOME/conf. |
| GENERIC_OPTIONS | The common set of options supported by multiple commands. Full list is here. |
| COMMAND_OPTIONS | Various commands with their options are described in the following sections. The commands have been grouped into and . |
| GENERIC_OPTION | Description |
|---|---|
| -conf <configuration file> | Specify an application configuration file. 指定配置文件 |
| -D <property>=<value> | Use value for given property. 指定属性 |
| -jt <local> or <resourcemanager:port> | Specify a ResourceManager. Applies only to job. 指定资源管理器 |
| -files <comma separated list of files> | Specify comma separated files to be copied to the map reduce cluster. Applies only to job. |
| -libjars <comma seperated list of jars> | Specify comma separated jar files to include in the classpath. Applies only to job. |
| -archives <comma separated list of archives> | Specify comma separated archives to be unarchived on the compute machines. Applies only to job. |
Usage: hdfs namenode [-backup] |
[-checkpoint] |
[-format [-clusterid cid ] [-force] [-nonInteractive] ] |
[-upgrade [-clusterid cid] [-renameReserved<k-v pairs>] ] |
[-upgradeOnly [-clusterid cid] [-renameReserved<k-v pairs>] ] |
[-rollback] |
[-rollingUpgrade <downgrade|rollback> ] |
[-finalize] |
[-importCheckpoint] |
[-initializeSharedEdits] |
[-bootstrapStandby] |
[-recover [-force] ] |
[-metadataVersion ]
hdfs secondarynamenode [-checkpoint [force]] | [-format] | [-geteditsize]
| COMMAND_OPTION | Description |
|---|---|
| -checkpoint [force] | Checkpoints the SecondaryNameNode if EditLog size >= fs.checkpoint.size. If force is used, checkpoint irrespective of EditLog size. |
| -format | Format the local storage during startup. |
| -geteditsize | Prints the number of uncheckpointed transactions on the NameNode. |
hdfs storagepolicies 列出策略
hdfs dfsadmin -setStoragePolicy <path> <policyName> 设置策略
hdfs dfsadmin -getStoragePolicy <path> 获取策略
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">
原文:http://www.cnblogs.com/skyrim/p/7455532.html