Time for action – changing job priorities and killing a job

Let's explore job priorities by changing them dynamically and watching the result of killing a job.

  1. Start a relatively long-running job on the cluster.
    $ hadoop jar hadoop-examples-1.0.4.jar pi 100 1000
    
  2. Open another window and submit a second job.
    $ hadoop jar hadoop-examples-1.0.4.jar wordcount test.txt out1
    
  3. Open another window and submit a third.
    $ hadoop jar hadoop-examples-1.0.4.jar wordcount test.txt out2
    
  4. List the running jobs.
    $ Hadoop job -list
    

    You'll see the following lines on the screen:

    3 jobs currently running
    JobId  State  StartTime  UserName  Priority  SchedulingInfo
    job_201201111540_0005  1  1326325810671  hadoop  NORMAL  NA
    job_201201111540_0006  1  1326325938781  hadoop  NORMAL  NA
    

Get Hadoop: Data Processing and Modelling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.