yarn命令 中文

 

概述

YARN命令通过bin/yarn 脚本调用.不传入任何参数运行该脚本会打印所有命令的描述。

Usage: yarn [--config confdir] COMMAND [--loglevel loglevel] [GENERIC_OPTIONS] [COMMAND_OPTIONS]

YARN有一个option解析框架用来解析通用options和运行class。

COMMAND_OPTIONSDescription
--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_OPTIONSDescription
-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_OPTIONSDescription
-helpHelp
-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_OPTIONSDescription
-helpHelp
-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_OPTIONSDescription
-applicationId <application ID>指定application id。
-appOwner <AppOwner>AppOwner (如果未指定则为当前用户)
-containerId <ContainerId>ContainerId (如果node address已经指定则该项必须指定)
-helpHelp
-nodeAddress <NodeAddress>NodeAddress 采用以下格式:nodename:port (如果container id指定了则该项必须指定)

Dump the container logs

node

Usage: yarn node [options]

COMMAND_OPTIONSDescription
-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_OPTIONSDescription
-helpHelp
-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_OPTIONSDescription
-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_OPTIONSDescription
-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_OPTIONSDescription
-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_OPTIONSDescription
-helpHelp
-runCleanerTask执行清除task

Runs Shared Cache Manager admin client

sharedcachemanager

Usage: yarn sharedcachemanager

Start the Shared Cache Manager

timelineserver

Usage: yarn timelineserver

Start the TimeLineServer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值