0

I am new in yarn resource manager admin commands, I know how to check the status of the application with -appStates keyword. For example,

yarn application -list -appStates FINISHED

will give all the finished jobs. We can do more with states like RUNNING, NEW, ALL, NEW_SAVING, SUBMITTED, ACCEPTED, FINISHED, FAILED, KILLED. But how to fetch the recent application submitted. Is there any keyword RECENT? Something like this:

yarn application -list -appStates RECENT

Thanks in Advance

1 Answers1

0

If you want more fine-grained control of this, you should use the YARN Resource Manager REST APIs. The Cluster Applications API allows you to specify startedTimeBegin and startedTimeEnd which you can use to define how much time you mean by RECENT. Just remember time is specified in milliseconds not seconds.

This simple script shows how you'd see jobs created in the last 5 minutes.

starttime=`date +"%s"`
let starttime=starttime-300
curl RM_URL/ws/v1/cluster/apps?startedTimeBegin=${starttime}000
tk421
  • 5,775
  • 6
  • 23
  • 34