如何获取当前正在运行的hadoop作业的名称? [英] How to get names of the currently running hadoop jobs?
本文介绍了如何获取当前正在运行的hadoop作业的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要获取当前正在运行的作业名称列表,但是 hadoop -job list
给我一个jobID列表。
- 是否有办法获取正在运行的作业的名称?
- 有没有办法从jobID获取工作名称?
解决方案
次,所以我想出了下面的命令行,你可以把它放在脚本的某处并重用。它打印jobid后跟作业名称。
hadoop job -list | egrep'^ job'| awk'{print $ 1}'| xargs -n 1 -I {} sh -chadoop job -status {} | egrep'^ tracking'| awk'{print \ $ 3}'| xargs -n 1 -I {} sh -cecho -n {} | sed's /.* jobid = //'; echo -n''; curl -s -XGET {} | grep'Job Name'| sed's /.* //'| sed's /< br> //'
I need to get the list of job names that currently running, but hadoop -job list
give me a list of jobIDs.
- Is there a way to get names of the running jobs?
- Is there a way to get the job names from jobIDs?
解决方案
I've had to do this a number of times so I came up with the following command line that you can throw in a script somewhere and reuse. It prints the jobid followed by the job name.
hadoop job -list | egrep '^job' | awk '{print $1}' | xargs -n 1 -I {} sh -c "hadoop job -status {} | egrep '^tracking' | awk '{print \$3}'" | xargs -n 1 -I{} sh -c "echo -n {} | sed 's/.*jobid=//'; echo -n ' ';curl -s -XGET {} | grep 'Job Name' | sed 's/.* //' | sed 's/<br>//'"
这篇关于如何获取当前正在运行的hadoop作业的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文