從零自學Hadoop(13):Hadoop命令下

sinodzh發表於2015-10-14

閱讀目錄

本文版權歸mephisto和部落格園共有,歡迎轉載,但須保留此段宣告,並給出原文連結,謝謝合作。

文章是哥(mephisto)寫的,SourceLink

 

  上一篇,我們對Hadoop命令中的HDFS Commands進行了簡略的列舉,下面我們就MapReduce Commands和Yarn Commands進行簡略的列舉,官網基本都是英文的,所以只能拙略的翻譯下,妄大家見諒。

  下面,我們就開始對Hadoop命令下進行講解。

MapReduce Commands

一:介紹

  所有的MapReduce命令通過bin/ mapred指令碼呼叫。不指定引數執行mapred指令碼會列印所有命令的描述。

  用法: mapred [SHELL_OPTIONS] COMMAND [GENERIC_OPTIONS] [COMMAND_OPTIONS]

  Hadoop有一個選項解析框架用於解析一般的選項和執行類。

COMMAND_OPTIONSDescription
SHELL_OPTIONS The common set of shell options. These are documented on the Hadoop Commands Reference page.
GENERIC_OPTIONS The common set of options supported by multiple commands. See the Hadoop Commands Reference 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.

User Commands

一:介紹

  用於Hadoop叢集使用者命令。

二:archive

  建立一個Hadoop檔案.More information can be found at Hadoop Archives Guide.

三:classpath

  列印Hadoop jar和所需的libs的class路徑。

  用法: mapred classpath

四:distcp

  遞迴複製檔案或目錄. More information can be found at Hadoop DistCp Guide.

五:job

  MapReduce jobs的命令

  用法: mapred job | [GENERIC_OPTIONS] | [-submit <job-file>] | [-status <job-id>] | [-counter <job-id> <group-name> <counter-name>] | [-kill <job-id>] | [-events <job-id> <from-event-#> <#-of-events>] | [-history [all] <jobOutputDir>] | [-list [all]] | [-kill-task <task-id>] | [-fail-task <task-id>] | [-set-priority <job-id> <priority>]

六:pipes

  執行一個pipes job.

  用法: mapred pipes [-conf <path>] [-jobconf <key=value>, <key=value>, ...] [-input <path>] [-output <path>] [-jar <jar file>] [-inputformat <class>] [-map <class>] [-partitioner <class>] [-reduce <class>] [-writer <class>] [-program <executable>] [-reduces <num>]

七:queue

  檢視作業佇列資訊

  用法:  mapred queue [-list] | [-info <job-queue-name> [-showJobs]] | [-showacls]

八:version

  列印版本。

  用法:  mapred version

Administration Commands

一:介紹

  用於Hadoop叢集使用者命令。

二:historyserver

    啟動JobHistoryServer.

  用法: mapred historyserver

三:hsadmin

  執行一個MapReduce hsadmin客戶端執行jobhistoryserver administrative命令。

  用法:Usage: mapred hsadmin [-refreshUserToGroupsMappings] | [-refreshSuperUserGroupsConfiguration] | [-refreshAdminAcls] | [-refreshLoadedJobCache] | [-refreshLogRetentionSettings] | [-refreshJobRetentionSettings] | [-getGroups [username]] | [-help [cmd]]

YARN Commands

一:介紹

  所有的YARN命令通過bin/yarn 指令碼呼叫。不指定引數執行yarn指令碼會列印所有命令的描述。

  用法: yarn [--config confdir] COMMAND [--loglevel loglevel] [GENERIC_OPTIONS] [COMMAND_OPTIONS]

  YARN有一個選項解析框架用於解析一般的選項和執行類。

User Commands

一:介紹

  用於Hadoop叢集使用者命令。

二:application

  列印app報表或kill掉app

  用法: yarn application [options]

三:applicationattempt

  列印applicationattempt(s) 報表

  用法: yarn applicationattempt [options]

四:classpath

  列印Hadoop jar和需要的庫類路徑。

  用法: yarn classpath

五:container

  列印container(s)報表

  用法: yarn container [options]

六:jar

  執行一個jar檔案。

  用法: yarn jar <jar> [mainClass] args...

七:logs

  轉儲容器日誌

  用法: yarn logs -applicationId <application ID> [options]

八:node

  列印node報表

  用法: yarn node [options]

九:queue

  列印queue資訊

  用法: yarn queue [options]

十:version

  列印hadoop版本。

  用法: yarn version

Administration Commands用

一:介紹

  用於Hadoop叢集使用者命令。

二:daemonlog

  獲取/設定在後臺Log的級別

  用法:yarn daemonlog -getlevel <host:httpport> <classname>
       yarn daemonlog -setlevel <host:httpport> <classname> <level>

三:nodemanager

  啟動NodeManager

  用法: yarn nodemanager

四:proxyserver

  啟動web proxy server

  用法: yarn proxyserver

五:resourcemanager

  啟動ResourceManager

  用法: yarn resourcemanager [-format-state-store]

六:rmadmin

  執行ResourceManager管理客戶端

用法:yarn rmadmin [-refreshQueues]
               [-refreshNodes]
               [-refreshUserToGroupsMapping]
               [-refreshSuperUserGroupsConfiguration]
               [-refreshAdminAcls]
               [-refreshServiceAcl]
               [-getGroups [username]]
               [-transitionToActive [--forceactive] [--forcemanual] <serviceId>]
               [-transitionToStandby [--forcemanual] <serviceId>]
               [-failover [--forcefence] [--forceactive] <serviceId1> <serviceId2>]
               [-getServiceState <serviceId>]
               [-checkHealth <serviceId>]
               [-help [cmd]]

七:scmadmin

  執行Shared Cache Manager管理客戶端

  用法: yarn scmadmin [options]

八:sharedcachemanager

  啟動Shared Cache Manager

  用法: yarn sharedcachemanager

九:timelineserver

  啟動TimeLineServer

  用法: yarn timelineserver

--------------------------------------------------------------------

  到此,本章節的內容講述完畢。

引用

Apache  MapReduce Commands:http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html

Apache YARN Commands:http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YarnCommands.html

Apache 1.04 中文:http://hadoop.apache.org/docs/r1.0.4/cn/commands_manual.html

系列索引

  【源】從零自學Hadoop系列索引

 

 

 

 

本文版權歸mephisto和部落格園共有,歡迎轉載,但須保留此段宣告,並給出原文連結,謝謝合作。

文章是哥(mephisto)寫的,SourceLink

 

相關文章