本文版權歸mephisto和博客園共有,歡迎轉載,但須保留此段聲明,並給出原文連接,謝謝合做。html
文章是哥(mephisto)寫的,SourceLinknode
上一篇,咱們對Hadoop命令進行了簡略的列舉,可是Hadoop命令特多,還有一部分沒有列舉完,官網基本都是英文的,因此只能拙略的翻譯下,妄你們見諒。web
下面,咱們就開始對Hadoop命令中進行講解。shell
一:介紹
全部的HDFS命令經過bin/ HDFS腳本調用。指定參數運行HDFS腳本會打印全部命令的描述。apache
用法: hdfs [SHELL_OPTIONS] COMMAND [GENERIC_OPTIONS] [COMMAND_OPTIONS]bootstrap
Hadoop有一個選項解析框架用於解析通常的選項和運行類。app
COMMAND_OPTIONS Description --config
--loglevelThe common set of shell options. These are documented on the Commands Manual page. GENERIC_OPTIONS The common set of options supported by multiple commands. See the Hadoop Commands Manual for more information. COMMAND COMMAND_OPTIONS Various commands with their options are described in the following sections. The commands have been grouped into User Commands and Administration Commands.
一:介紹
用於Hadoop集羣用戶命令。框架
二:classPath
打印Hadoop jar和須要的庫類路徑。ide
用法: hdfs classpath工具
三:dfs
運行在支持Hadoop文件系統文件系統的命令.The various COMMAND_OPTIONS can be found at File System Shell Guide.
用法: hdfs dfs [COMMAND [COMMAND_OPTIONS]]
四:fetchdt
從NameNode獲取受權令牌.See fetchdt for more info.
用法: hdfs fetchdt [--webservice <namenode_http_addr>] <path>
五:fsck
在HDFS文件系統檢查工具.See fsck for more info.
用法:hdfs fsck <path>
[-list-corruptfileblocks |
[-move | -delete | -openforwrite]
[-files [-blocks [-locations | -racks]]]
[-includeSnapshots]六:getconf
從配置目錄中獲取配置信息而後處理。
用法:hdfs getconf -namenodes
hdfs getconf -secondaryNameNodes
hdfs getconf -backupNodes
hdfs getconf -includeFile
hdfs getconf -excludeFile
hdfs getconf -nnRpcAddresses
hdfs getconf -confKey [key]七:groups
返回給定的一個或多個用戶組信息。
用法: hdfs groups [username ...]
八:lsSnapshottableDir
得到snapshottable目錄列表。當是超級用戶運行時,它返回全部的snapshottable目錄。不然它返回當前用戶所擁有的目錄。
用法: hdfs lsSnapshottableDir [-help]
九:jmxget
把一個服務的JMX信息丟棄
用法: hdfs jmxget [-localVM ConnectorURL | -port port | -server mbeanserver | -service service]
十:oev
Hadoop離線編輯查看器。
用法: hdfs oev [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE
十一:oiv
用於查看較新的鏡像文件的Hadoop離線鏡像查看器
用法: hdfs oiv [OPTIONS] -i INPUT_FILE
十二:oiv_legacy
老版本的Hadoop Hadoop離線鏡像查看器。
用法: hdfs oiv_legacy [OPTIONS] -i INPUT_FILE -o OUTPUT_FILE
十三:snapshotDiff
肯定HDFS的快照之間的差別。See the HDFS Snapshot Documentation for more information.
用法: hdfs snapshotDiff <path> <fromSnapshot> <toSnapshot>
十四:version
打印版本。
用法: hdfs version
一:介紹
用於Hadoop集羣用戶命令。
二:balancer
運行羣集平衡實用程序。管理員能夠按Ctrl-C中止再平衡過程。See Balancer for more details.
用法:hdfs balancer
[-threshold <threshold>]
[-policy <policy>]
[-exclude [-f <hosts-file> | <comma-separated list of hosts>]]
[-include [-f <hosts-file> | <comma-separated list of hosts>]]
[-idleiterations <idleiterations>]三:crypto
See the HDFS Transparent Encryption Documentation for more information.
用法:hdfs crypto -createZone -keyName <keyName> -path <path>
hdfs crypto -help <command-name>
hdfs crypto -listZones四:datanode
運行一個HDFS datanode
用法: hdfs datanode [-regular | -rollback | -rollingupgrace rollback]
五:dfsadmin
運行一個HDFS dfsadmin客戶端
用法:hdfs dfsadmin [GENERIC_OPTIONS]
[-report [-live] [-dead] [-decommissioning]]
[-safemode enter | leave | get | wait]
[-saveNamespace]
[-rollEdits]
[-restoreFailedStorage true |false |check]
[-refreshNodes]
[-setQuota <quota> <dirname>...<dirname>]
[-clrQuota <dirname>...<dirname>]
[-setSpaceQuota <quota> <dirname>...<dirname>]
[-clrSpaceQuota <dirname>...<dirname>]
[-setStoragePolicy <path> <policyName>]
[-getStoragePolicy <path>]
[-finalizeUpgrade]
[-rollingUpgrade [<query> |<prepare> |<finalize>]]
[-metasave filename]
[-refreshServiceAcl]
[-refreshUserToGroupsMappings]
[-refreshSuperUserGroupsConfiguration]
[-refreshCallQueue]
[-refresh <host:ipc_port> <key> [arg1..argn]]
[-reconfig <datanode |...> <host:ipc_port> <start |status>]
[-printTopology]
[-refreshNamenodes datanodehost:port]
[-deleteBlockPool datanode-host:port blockpoolId [force]]
[-setBalancerBandwidth <bandwidth in bytes per second>]
[-allowSnapshot <snapshotDir>]
[-disallowSnapshot <snapshotDir>]
[-fetchImage <local directory>]
[-shutdownDatanode <datanode_host:ipc_port> [upgrade]]
[-getDatanodeInfo <datanode_host:ipc_port>]
[-triggerBlockReport [-incremental] <datanode_host:ipc_port>]
[-help [cmd]]六:haadmin
See HDFS HA with NFS or HDFS HA with QJM for more information on this command.
用法:hdfs haadmin -checkHealth <serviceId>
hdfs haadmin -failover [--forcefence] [--forceactive] <serviceId> <serviceId>
hdfs haadmin -getServiceState <serviceId>
hdfs haadmin -help <command>
hdfs haadmin -transitionToActive <serviceId> [--forceactive]
hdfs haadmin -transitionToStandby <serviceId>七:journalnode
This comamnd starts a journalnode for use with HDFS HA with QJM.
用法: hdfs journalnode
八:mover
運行數據遷移實用程序. See Mover for more details.
用法: hdfs mover [-p <files/dirs> | -f <local file name>]
九:namenode
運行namenode. More info about the upgrade, rollback and finalize is at Upgrade Rollback.
用法: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 ]十:nfs3
該指令從HDFS nfs3服務使用nfs3網關。
用法: hdfs nfs3
十一:portmap
該指令從HDFS nfs3服務使用RPC portmap。
用法:Usage: hdfs portmap
十二:secondarynamenode
運行 second namenode.See Secondary Namenode for more info.
用法: hdfs secondarynamenode [-checkpoint [force]] | [-format] | [-geteditsize]
十三:storagepolicies
列出全部存儲策。See the HDFS Storage Policy Documentation for more information.
十四:zkfc
這個指令開始一個管理員切換控制器的過程使用HDFS HA QJM。
用法: hdfs zkfc [-formatZK [-force] [-nonInteractive]]
一:介紹
爲了幫助管理員調試HDFS問題有用的命令,如驗證塊文件和調用recoverlease。
二:verify
HDFS的元數據和文件塊的驗證。若是一個塊指定文件,咱們將驗證在元數據文件的校驗和匹配塊文件。
用法: hdfs debug verify [-meta <metadata-file>] [-block <block-file>]
三:recoverLease
恢復指定路徑上的租約。路徑必須駐留在一個HDFS文件系統。重試的默認號碼是1。
用法: hdfs debug recoverLease [-path <path>] [-retries <num-retries>]
--------------------------------------------------------------------
到此,本章節的內容講述完畢。
Apache hadoop commands:http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html
Apache 1.04 中文:http://hadoop.apache.org/docs/r1.0.4/cn/commands_manual.html
本文版權歸mephisto和博客園共有,歡迎轉載,但須保留此段聲明,並給出原文連接,謝謝合做。
文章是哥(mephisto)寫的,SourceLink