Skip to content

Instantly share code, notes, and snippets.

@slitayem
Created August 9, 2020 14:13
Show Gist options
  • Save slitayem/4866956c0ae547bbd82a730a31ad3096 to your computer and use it in GitHub Desktop.
Save slitayem/4866956c0ae547bbd82a730a31ad3096 to your computer and use it in GitHub Desktop.
Yarn commands to manage Yarn applications

List all Yarn aplications in ACCEPTED state

for x in $(yarn application -list -appStates ACCEPTED | awk 'NR > 2 { print $1 }'); do yarn application -kill $x; done

Kill all aplications in RUNNING state

for x in $(yarn application -list -appStates RUNNING | awk 'NR > 2 { print $1 }'); do yarn application -kill $x; done

Kill al spark applications

for x in $(yarn application -list -appTypes SPARK | awk 'NR > 2 { print $1 }'); do yarn application -kill $x; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment