Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to kill a mapred job started by hive?

I'm working by CDH 5.1 now. It starts normal Hadoop job by YARN but hive still works with mapred. Sometimes a big query will hang for a long time and I want to kill it.

I can find this big job by JobTracker web console while it didn't provide a button to kill it.

Another way is killing by command line. However, I couldn't find any job running by command line.

I have tried 2 commands:

  • yarn application -list
  • mapred job -list

How to kill big query like this?

like image 323
2shou Avatar asked Feb 12 '15 06:02

2shou


1 Answers

You can get the Job ID from Hive CLI when you run a job or from the Web UI. You can also list the job IDs using the application ID from resource manager. Ideally, you should get everything from

mapred job -list

or

hadoop job -list

Using the Job ID you can kill it by using the below command.

hadoop job -kill <job_id>

Another alternative would be to kill the application using

yarn application -kill <application_id>
like image 115
Harman Avatar answered Sep 19 '22 16:09

Harman