Share via

How to Find and Kill a running Yarn Application Master in HDInsight with and without SSH access

Today we faced a challenge in HDInsight not knowing the SSH user password to terminal into the server, and we needed to kill some running Hive jobs that were too far gone and taking too many resources.

The user knows the user name and password for Hadoop and Ambari, but does not know the SSH user name and password. HDInsight uses separate accounts and passwords for these two purposes.

Without SSH use cURL to talk REST to kill it

You can use the REST endpoints for Resource manager in HDInsight to kill an application using the Hadoop/Ambari password.

1. Download or build your own cURL for Windows, I found it here

Make sure to get one WITH SUPPORT SSL (Since HDInsight only works in HTTPS)


2. To check the application status, you can get a long list of all the applications

 curl -u admin:SomePassword -H "Content-Type: application/json" -d ""

Or focus in on your one application-id

 curl -u admin:SomePassword -H "Content-Type: application/json" -d ""


3. To Kill a job,on the commandline, run cURL to point to your HDInsight server and the application id, and PUT to change the state to KILLED, effectively killing the Yarn job.

 curl -u admin:SomePassword -v -X PUT -H "Content-Type: application/json" -d '{"state": "KILLED"}' ""



Note: for special characters I found I could use an escape character \ before the special character in the password.

If you get an error about https, try "" double-quotes around the URL instead of '' single-quotes.

More Resource Manager REST options


With SSH use Yarn commands to list and kill applications

I am used to killing Yarn applications like this, over a BASH session connected with the ssh account credentials. From SSH paste in the application name and this command should attempt the kill

 yarn application -kill application_000000000000000_0001

To find the application ID , you can do yarn application -list or use the resource manager UI from the active head node.

From Ambari click Dashbaord, then YARN links tile, click Moreā€¦ > and pick the Active head node, then click the menu for ResourceManagerUI



It will jump to the website like this URL

The first column lists the application ID, which is what Yarn needs to know to kill something.