<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: start and stop all the services in ambari in time intervals? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219136#M69511</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18483/ppavan10.html" nodeid="18483"&gt;@pavan p&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can make use fo Ambari APIs to do the same and run the following kind of API calls using curl using Cron Job at the mentioned times.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stop All Services of an ambari managed cluster&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.STOP.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Start All Services of an ambari managed cluster&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Here following are the values that you will have to change:&lt;BR /&gt;&lt;STRONG&gt;BlueprintCluster:&lt;/STRONG&gt;  Replace it with your Cluster Name&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;blueprint.example.com:&lt;/STRONG&gt; Replace it with your Ambari Server Hostname&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 20:22:33 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-10-12T20:22:33Z</dc:date>
    <item>
      <title>start and stop all the services in ambari in time intervals?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219135#M69510</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;&lt;P&gt;i want to start all the services in ambari in time inrevals in autmated way.&lt;/P&gt;&lt;P&gt;
like i need all the services to start daily at 7am and i want to stop at 5pm. &lt;/P&gt;&lt;P&gt;so that i will start the ec2-instances at 6:30am and i will stop those by 5:30pm. &lt;/P&gt;&lt;P&gt;can you please help me out. &lt;/P&gt;&lt;P&gt;thanks in advance &lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 19:41:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219135#M69510</guid>
      <dc:creator>ppavan10</dc:creator>
      <dc:date>2017-10-12T19:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: start and stop all the services in ambari in time intervals?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219136#M69511</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18483/ppavan10.html" nodeid="18483"&gt;@pavan p&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can make use fo Ambari APIs to do the same and run the following kind of API calls using curl using Cron Job at the mentioned times.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stop All Services of an ambari managed cluster&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.STOP.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Start All Services of an ambari managed cluster&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Here following are the values that you will have to change:&lt;BR /&gt;&lt;STRONG&gt;BlueprintCluster:&lt;/STRONG&gt;  Replace it with your Cluster Name&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;blueprint.example.com:&lt;/STRONG&gt; Replace it with your Ambari Server Hostname&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:22:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219136#M69511</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-10-12T20:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: start and stop all the services in ambari in time intervals?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219137#M69512</link>
      <description>&lt;P&gt;can you please tell me how to setup cron job for the rest api&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:56:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219137#M69512</guid>
      <dc:creator>ppavan10</dc:creator>
      <dc:date>2017-10-12T20:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: start and stop all the services in ambari in time intervals?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219138#M69513</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18483/ppavan10.html" nodeid="18483"&gt;@pavan p&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Open a terminal and run the following command to open the crontab editor (it's like "vi" editor)&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# crontab -e&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;2. Now add the following entries inside it:  (here  30 17  means  5:30 PM)  and similarly  (30 06 means 6:30 AM)&lt;/P&gt;&lt;PRE&gt;30 17 * * * curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.STOP.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?

30 06 * * * curl -u admin:admin  -H 'X-Requested-By:ambari' -X PUT     -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"BlueprintCluster"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' &lt;A href="http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services" target="_blank"&gt;http://blueprint.example.com:8080/api/v1/clusters/BlueprintCluster/services&lt;/A&gt;?&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reference: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.drupal.org/docs/7/setting-up-cron-for-drupal/configuring-cron-jobs-using-the-cron-command" target="_blank"&gt;https://www.drupal.org/docs/7/setting-up-cron-for-drupal/configuring-cron-jobs-using-the-cron-command&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18483/ppavan10.html" nodeid="18483"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 21:33:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/start-and-stop-all-the-services-in-ambari-in-time-intervals/m-p/219138#M69513</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-10-12T21:33:51Z</dc:date>
    </item>
  </channel>
</rss>

