一. yarn命令
[ruoze@rzdata001 ~]$ which yarn
~/app/hadoop/bin/yarn
[ruoze@rzdata001 ~]$
yarn -help
yarn查看帮助
[ruoze@rzdata001 ~]$ yarn -help
Usage: yarn [--config confdir] COMMAND
where COMMAND is one of:
resourcemanager -format-state-store deletes the RMStateStore
resourcemanager run the ResourceManager
Use -format-state-store for deleting the RMStateStore.
Use -remove-application-from-state-store <appId> for
removing application from RMStateStore.
nodemanager run a nodemanager on each slave
timelineserver run the timeline server
rmadmin admin tools
version print the version
jar <jar> run a jar file
application prints application(s)
report/kill application
applicationattempt prints applicationattempt(s)
report
container prints container(s) report
node prints node report(s)
queue prints queue information
logs dump container logs
classpath prints the class path needed to
get the Hadoop jar and the
required libraries
daemonlog get/set the log level for each
daemon
top run cluster usage tool
or
CLASSNAME run the class named CLASSNAME
Most commands print help when invoked w/o parameters.
[ruoze@rzdata001 ~]$
常用如下:
yarn application
查看运行状态的任务,kill任务
yarn application -appStates ACCEPTED -list | awk -F "[@\t]" '{print $1,$4,$5,$6,$8,$2}' |grep username
yarn application -appStates RUNNING -list | awk -F "[@\t]" '{print $1,$4,$5,$6,$8,$2}' |grep username| grep 1545793104252_12911737
yarn application -kill application_1545793104252_123456789
yarn logs
提取相关日志
yarn logs -applicationId application_1566295658573_11041748 > ./job.log