`
han_zw
  • 浏览: 171607 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

hadoop 2.7.2 yarn中文文档——YARN 命令

 
阅读更多
概述
YARN命令通过bin/yarn 脚本调用.不传入任何参数运行该脚本会打印所有命令的描述。
Usage: yarn [--config confdir] COMMAND [--loglevel loglevel] [GENERIC_OPTIONS] [COMMAND_OPTIONS]
YARN有一个option解析框架用来解析通用options和运行class。
COMMAND_OPTIONS Description
--config confdir 覆盖默认的配置目录。默认为${HADOOP_PREFIX}/conf
--loglevel loglevel 覆盖log level。有效的log level是FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. 默认是INFO。
GENERIC_OPTIONS 多个命令支持的通用选项集合。
COMMAND COMMAND_OPTIONS 各种command以及它们的选项在以下章节描述。commands已经被分为了User Command和Administration Command。
User Commands
对Hadoop集群用户有用的Command。
application
Usage: yarn application [options]
COMMAND_OPTIONS Description
-appStates <States> 与-list一起使用可以基于输入的逗号分隔的application states列表过滤application。有效的application state可以是如下:ALL, NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED
-appTypes <Types> 与-list一起使用,基于传入的逗号分隔的application types列表过滤application。
-list 从RM查看application列表。支持使用-appTypes选项,基于application type对application进行过滤。支持使用-appStates选项,基于application state对application进行过滤。
-kill <ApplicationId> 杀死application
-status <ApplicationId> 打印application状态。
打印application report/杀死application
applicationattempt
Usage: yarn applicationattempt [options]
COMMAND_OPTIONS Description
-help Help
-list <ApplicationId> 列出指定application的application attempts 。
-status <Application Attempt Id> 打印application attempt的状态信息。
打印applicationattempt report
classpath
Usage: yarn classpath
打印需要hadoop jar和其他library的class path
container
Usage: yarn container [options]
COMMAND_OPTIONS Description
-help Help
-list <Application Attempt Id> 列出application attempt的container列表。
-status <ContainerId> 打印container的状态。
打印container report
jar
Usage: yarn jar <jar> [mainClass] args...
运行一个jar文件。用户可以将他们的YARN代码打包到一个jar文件,可以使用这个command执行它。
logs
Usage: yarn logs -applicationId <application ID> [options]
COMMAND_OPTIONS Description
-applicationId <application ID> 指定application id。
-appOwner <AppOwner> AppOwner (如果未指定则为当前用户)
-containerId <ContainerId> ContainerId (如果node address已经指定则该项必须指定)
-help Help
-nodeAddress <NodeAddress> NodeAddress 采用以下格式:nodename:port (如果container id指定了则该项必须指定)
Dump the container logs
node
Usage: yarn node [options]
COMMAND_OPTIONS Description
-all 与-list一起使用可列出所有node。
-list 列出所有running的node。支持使用-states选项基于node state对node进行过滤,-all表示列出所有node。
-states <States> 与-list一起使用可以基于输入的逗号分隔的node state列表进行node的过滤。
-status <NodeId> 打印node的status report
打印node report
queue
Usage: yarn queue [options]
COMMAND_OPTIONS Description
-help Help
-status <QueueName> 打印队列状态信息。
打印队列信息
version
Usage: yarn version
打印hadoop版本.
 
管理Commands
管理hadoop集群的相关命令。
daemonlog
Usage:
yarn daemonlog -getlevel <host:httpport> <classname> yarn daemonlog -setlevel <host:httpport> <classname> <level>
COMMAND_OPTIONS Description
-getlevel <host:httpport> <classname> 打印出运行在<host:httpport>deamon中的classname的log日志级别。这个命令内部连接到http://<host:httpport>/logLevel?log=<classname>。
-setlevel <host:httpport> <classname> <level> 设置运行在<host:httpport>的deamon中的classname的日志级别。这个命令内部是连接到http://<host:httpport>/logLevel?log=<classname>&level=<level><level>http://<host:httpport>/logLevel?log=<classname>&level=<level> http://<host:httpport>/logLevel?log=<classname>&level=<level>
Get/Set deamon中class name的日志级别。
示例: $ bin/yarn daemonlog -setlevel 127.0.0.1:8088 org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl DEBUG
nodemanager
Usage: yarn nodemanager
启动NodeManager
proxyserver
Usage: yarn proxyserver
启动web proxy server
resourcemanager
Usage: yarn resourcemanager [-format-state-store]
COMMAND_OPTIONS Description
-format-state-store 格式化RMStateStore。这将会清除RMStateStroe,这在旧数据不在需要时会用到。这只应该是在ResourceManager不运行的时候执行。
启动ResourceManager
rmadmin
Usage:
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]]
COMMAND_OPTIONS Description
-refreshQueues 重新加载队列的acls,state和scheduler特定属性。ResourceManager会重新加载mapred-queues配置文件。
-refreshNodes 在ResourceManager中刷新host信息。
-refreshUserToGroupsMappings 刷新用户-组映射。
-refreshSuperUserGroupsConfiguration 刷新超级用户代理组映射。
-refreshAdminAcls 刷新ResourceManager的administration acls。
-refreshServiceAcl 重新加载service-level授权策略文件,ResourceManager会重新加载授权策略文件。
-getGroups [username] 获取指定用户属于的组。
-transitionToActive [–forceactive] [–forcemanual] <serviceId> 将service转换为Active state. 如果使用了 –forceactive选项,那么目标直接active,无需检查当前是否已经没有active node。如果自动灾备启用的话,不能使用该命令。虽然你可以通过forcemanual 选项强行override,但是你需要非常小心。
-transitionToStandby [–forcemanual] <serviceId> 将service转换为standby状态。这个命令不能在自动灾备启用的情况下使用。虽然你可以通过forcemanual 选项强行override,但是你需要非常小
-failover [–forceactive] <serviceId1> <serviceId2> 初始化故障恢复,从serviceId1 切换到serviceId2。如果使用-forceactive 选项,那么会转移到目标service,哪怕它还没有ready。
-getServiceState <serviceId> 获取service的state。
-checkHealth <serviceId> 请求对service执行一次健康度检查。如果检查失败,RMAdmin工具的退出码为非零数字。
-help [cmd] 显示指定command的帮助信息,如果未指定则显示全部命令的帮助信息。
运行ResourceManager 管理客户端。
scmadmin
Usage: yarn scmadmin [options]
COMMAND_OPTIONS Description
-help Help
-runCleanerTask 执行清除task
Runs Shared Cache Manager admin client
sharedcachemanager
Usage: yarn sharedcachemanager
Start the Shared Cache Manager
timelineserver
Usage: yarn timelineserver
Start the TimeLineServer
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics