一. yarn命令
[ruoze@rzdata001 ~]$ which yarn
~/app/hadoop/bin/yarn
[ruoze@rzdata001 ~]$
yarn -helpyarn查看帮助
[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
本文详细介绍了YARN命令的使用方法,包括资源管理、节点管理、应用管理和日志提取等核心功能。通过实例展示了如何查看运行状态的任务、杀死特定任务及提取相关日志,为Hadoop集群的运维提供了实用指南。
1140

被折叠的 条评论
为什么被折叠?



