[英]how to Kill hadoop task started using hadoop jar command?
I'm pretty new to using Hadoop. 我对使用Hadoop很陌生。
I used hadoop jar command like the one below - 我像下面的命令一样使用hadoop jar命令-
hadoop jar $jarpath/BDAnalytics.jar \
bigdat.twitter.crawler.CrawlTwitter \
$crwlInputFile > $logsFldr/crawler_$1.log 2>&1 &
But I need to kill this process, and not able to understand how. 但是我需要终止此过程,并且不知道如何操作。 There are a lot of links to kill hadoop jobs but since this is not a job but a task/java process. 有很多链接可以杀死hadoop作业,但是由于这不是作业,而是任务/ java进程。
I will high appreciate if you could let me know the command to kill such a process. 如果您可以让我知道杀死该进程的命令,我将不胜感激。 Thanks in advance! 提前致谢! -RG -RG
You can use the shell command kill
. 您可以使用shell命令kill
。 For example, use ps -ef | grep bigdat.twitter.crawler.CrawlTwitter
例如,使用ps -ef | grep bigdat.twitter.crawler.CrawlTwitter
ps -ef | grep bigdat.twitter.crawler.CrawlTwitter
to find the pid, and use kill -9 pid_of_the_process
to kill it. ps -ef | grep bigdat.twitter.crawler.CrawlTwitter
查找pid,然后使用kill -9 pid_of_the_process
杀死它。 You can write a script containing the following command to do the kill action: 您可以编写包含以下命令的脚本来执行kill操作:
#!/bin/bash
kill -9 $(ps -ef | grep bigdat.twitter.crawler.CrawlTwitter | sed "s/\s\+/\t/g" | cut -f2)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.