Community Articles
Find and share helpful community-sourced technical articles
Labels (2)
Contributor

STOP Command::

curl -u admin:admin -H "X-Requested-By:ambari" -i -X PUT http://172.26.78.29:8080/api/v1/clusters/Mycluster/hosts/prakash-ambariagent-node3/host_components/F... -d '{"RequestInfo":{"context":"Stop Flume","operation_level":{"level":"HOST_COMPONENT","cluster_name":"Mycluster","host_name":"prakash-ambariagent-node3","service_name":"FLUME"}},"Body":{"HostRoles":{"state":"INSTALLED"}}}'

START Command::

curl -u admin:admin -H "X-Requested-By:ambari" -i -X PUT http://172.26.78.29:8080/api/v1/clusters/Mycluster/hosts/prakash-ambariagent-node3/host_components/F... -d '{"RequestInfo":{"context":"Start Flume","operation_level":{"level":"HOST_COMPONENT","cluster_name":"Mycluster","host_name":"prakash-ambariagent-node3","service_name":"FLUME"}},"Body":{"HostRoles":{"state":"STARTED"}}}'

RESTART Command::

curl --insecure -v -u admin:admin -H "X-Requested-By:ambari" -i -X POST http://prakash-ambariserver-node1:8080/api/v1/clusters/Mycluster/requests -d '{"RequestInfo":{"command":"RESTART","context":"Restart all components for Flume","operation_level":{"level":"SERVICE","cluster_name":"Mycluster","service_name":"FLUME"}},"Requests/resource_filters":[{"service_name":"FLUME","component_name":"FLUME_HANDLER","hosts":"prakash-ambariagent-node3"}]}'

Note::Replace the ambari server host and clustername with your cluster details and execute the curl commands.

2,557 Views