Skip to main content
narendra_klu9
Silver ⭐️⭐️⭐️
Jun 10, 2019 3:21 PM UTC
Solved

Is there any ambari API to execute "refresh yarn queue's" command ?

I'm trying to execute the "Refresh yarn queue's" command through ambari API. Unable to find a solution for this. If anybody has any idea please let me know.

jsensharma
Platinum ⭐️⭐️
Jun 10, 2019 3:51 PM UTC

@Narendra Neerukonda

Ambari 2.7 you can try following kind of API calls.

# curl -k -H "X-Requested-By: ambari" -u admin:admin  -X POST -d '{"RequestInfo":{"context":"Refresh YARN Capacity Scheduler","command":"REFRESHQUEUES","parameters/forceRefreshConfigTags":"capacity-scheduler"},"Requests/resource_filters":[{"service_name":"YARN","component_name":"RESOURCEMANAGER","hosts":"kerlatest2.example.com,kerlatest4.example.com"}]}' http://kerlatest1.example.com:8080/api/v1/clusters/KerLatest/requests


Please replace the "kerlatest2.example.com,kerlatest4.example.com" with your YARN resource Manager hostnames, also replace the "kerlatest1.example.com:8080" with your Ambari Server hostname and port. And replace the "KerLatest" with your own cluster name.


Following article might give some idea in Kerberized environments:

https://community.hortonworks.com/content/supportkb/151093/how-do-i-refresh-yarn-capacity-scheduler-outside-o.html

2 replies

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
Jun 10, 2019 3:51 PM UTC

@Narendra Neerukonda

Ambari 2.7 you can try following kind of API calls.

# curl -k -H "X-Requested-By: ambari" -u admin:admin  -X POST -d '{"RequestInfo":{"context":"Refresh YARN Capacity Scheduler","command":"REFRESHQUEUES","parameters/forceRefreshConfigTags":"capacity-scheduler"},"Requests/resource_filters":[{"service_name":"YARN","component_name":"RESOURCEMANAGER","hosts":"kerlatest2.example.com,kerlatest4.example.com"}]}' http://kerlatest1.example.com:8080/api/v1/clusters/KerLatest/requests


Please replace the "kerlatest2.example.com,kerlatest4.example.com" with your YARN resource Manager hostnames, also replace the "kerlatest1.example.com:8080" with your Ambari Server hostname and port. And replace the "KerLatest" with your own cluster name.


Following article might give some idea in Kerberized environments:

https://community.hortonworks.com/content/supportkb/151093/how-do-i-refresh-yarn-capacity-scheduler-outside-o.html

Translate
ask_bill_brooks
Platinum ⭐️
Platinum ⭐️
Jun 10, 2019 7:57 PM UTC

The above question and the reply below was originally posted in the Community Help Track. On Mon Jun 10 12:55 UTC 2019, a member of the HCC moderation staff moved it to the Cloud & Operations track. The Community Help Track is intended for questions about using the HCC site itself.

Translate
Bill Brooks, Community Moderator Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button.