Member since
07-18-2017
10
Posts
0
Kudos Received
0
Solutions
07-08-2019
02:35 PM
Thanks @Akhil S Naik , I'm able to pass the parameters now. However, there is a problem i'm facing when i'm submitting the request with "Requests/resource_filters". If i do the below, the custom script is executed but, it gets executed on all hosts instead of only server1 and server2: -d '{"RequestInfo":{"context":"Execute an action", "action" : "stream_file", "parameters" : {"file" : "/hadoop_mount/hdfs.tar.gz"},"service_name" : "", "component_name":"", "hosts":"server1,server2"}}' http://ambari-server:8080/api/v1/clusters/<clustername>/requests To resolve this i added below as per from your above sample: -d '{"RequestInfo":{"context":"Execute an action", "action" : "stream_file", "parameters" : {"file" : "/hadoop01/hdfs.tar.gz"}},"Requests/resource_filters":[{"service_name" : "", "component_name":"", "hosts":"server1,server2"}]}' http://ambari-server:8080/api/v1/clusters/<clustername>/requests But when i submit this, even though the command goes to only the required hosts, it just goes into hung state (grey colored gears - Execution doesn't start at all.) Any idea on what might be blocking the execution ? With Regards, Narendra To the users who will come here in future, the parameter you passed will be available from the configs (config = Script.get_config()) inside your code and at config['roleParams']['my_input'] to be precise.
... View more
07-08-2019
10:02 AM
My previous comment is still under moderation but the solution is: Apparently, it's mandatory to pass value for service_name and component_name.
... View more
07-05-2019
06:31 AM
I'm working on a POC to take NN metadata backup. For this, i'm compressing the NN's metadata using a custom script that i will call through ambari API. (https://community.hortonworks.com/articles/139788/running-custom-scripts-through-ambari.html) . If i simply hardcode the datadirectory name it will work. However, i'm looking to pass them as an argument while submitting the request. Anyone aware of the method ?
... View more
Labels:
- Labels:
-
Apache Hadoop
06-10-2019
08:21 AM
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.
... View more
Labels:
- Labels:
-
Apache Ambari
-
Apache YARN
-
Cloudera Manager