How to kill a mapred job started by hive?
Asked Answered
A

1

8

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?

Anaesthesia answered 12/2, 2015 at 6:28 Comment(0)
B
18

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>
Buxom answered 12/2, 2015 at 6:36 Comment(6)
I tried but failed with Application with id 'application_201502060008_2375' doesn't exist in RM, it seems to use YARN but mapred.Anaesthesia
Substitute "job" for "application"... that should work... the ApplicationId is different from the JobId... the ApplicationId is for Yarn.Babcock
My original command is hadoop job -kill job_201502060008_2375 and the job was replaced with application. I don't know why.Anaesthesia
As I mentioned, you can also get the kill command from Hive CLI. It would give you a kill command once the execution kicks offBuxom
Thanks. How could I find the kill command when I closed Hive CLI?Anaesthesia
@Anaesthesia can you accept the answer, if it helped you?Buxom

© 2022 - 2024 — McMap. All rights reserved.