How to Abort a hung ambari operation
In a browser put in:
http://<AMBARI-HOST>:8080/api/v1/clusters/<CLUSTER-NAME>/requests/
Find the highest reqest number in the output. Now, we can go to each request by pasting in the number of the request, an example would be:
http://<AMBARI-HOST>:8080/api/v1/clusters/<CLUSTER-NAME>/requests/110
The output should look like:
{
"href" : "http://mon-orlan:8080/api/v1/clusters/test/requests/110",
"Requests" : {
"aborted_task_count" : 0,
"cluster_name" : "test",
"completed_task_count" : 3,
"create_time" : 1444340395849,
"end_time" : 1444340449936,
"exclusive" : false,
"failed_task_count" : 0,
"id" : 110,
"inputs" : "{}",
"operation_level" : "SERVICE",
"progress_percent" : 100.0,
"queued_task_count" : 0,
"request_context" : "Restart all components with Stale Configs for HIVE",
.....
If that is not your hung operation, go back one by one from the highest request number. What we are looking for is the request context matches your hung Operation, that is the one we want to abort. Once you find that request ID, then go to the ambari server command line as root and do:
curl -u admin:admin -i -H "X-RequestedBy:ambari" -X PUT -d '{"Requests":{"request_status":"ABORTED","abort_reason":"Aborted by user"}}' http://localhost:8080/api/v1/clusters/<CLUSTER_NAME>/requests/<REQUEST_ID>;

