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?

2shou
  • 145
  • 1
  • 1
  • 7

1 Answers1

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>
Harman
  • 751
  • 1
  • 9
  • 31
  • I tried but failed with `Application with id 'application_201502060008_2375' doesn't exist in RM`, it seems to use `YARN` but `mapred`. – 2shou Feb 12 '15 at 06:39
  • Substitute "job" for "application"... that should work... the ApplicationId is different from the JobId... the ApplicationId is for Yarn. – Pradeep Gollakota Feb 12 '15 at 07:00
  • My original command is `hadoop job -kill job_201502060008_2375` and the `job` was replaced with `application`. I don't know why. – 2shou Feb 12 '15 at 07:18
  • 1
    As I mentioned, you can also get the kill command from Hive CLI. It would give you a kill command once the execution kicks off – Harman Feb 12 '15 at 10:48
  • Thanks. How could I find the kill command when I closed Hive CLI? – 2shou Feb 13 '15 at 03:13
  • @2shou can you accept the answer, if it helped you? – Harman Jul 01 '16 at 23:56