Closed sbathehwx closed 7 years ago
To Stop: curl -vv -u admin:admin -H "X-Requested-By: ambari" -i -X PUT -d '{"RequestInfo":{"context":"_PARSE_.STOP.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"sbathe-hdp"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' http://node1.openstacklocal:8080/api/v1/clusters/sbathe-hdp/services
look for the task/request URL in the response:
Poll the URL for "request_status"
Once successful, sleep 30 seconds (to give java time to cleanup and exit cleanly)
To start back: curl -vv -u admin:admin -H "X-Requested-By: ambari" -i -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"sbathe-hdp"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://node1.openstacklocal:8080/api/v1/clusters/sbathe-hdp/services
Again poll for completion like we did for stop.
We need a script to stop / start or restart all the services in the cluster. While restart stale is good, it does not cover all our use cases.