<?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: how to stop all components on data-node machine ( worker machine ) by rest API in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179122#M72963</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;I guess you would be using curl, so providing the example in curl. This one is for the PUT call.&lt;/P&gt;&lt;PRE&gt;[root@ctr-e136-1513029738776-28711-01-000002 ~]# curl -XPUT -u admin:admin --header X-Requested-By:ambari &lt;A href="http://172.27.67.14:8080/api/v1/clusters/cl1/hosts/ctr-e136-1513029738776-28711-01-000002.hwx.site/host_components" target="_blank"&gt;http://172.27.67.14:8080/api/v1/clusters/cl1/hosts/ctr-e136-1513029738776-28711-01-000002.hwx.site/host_components&lt;/A&gt; -d '&lt;BR /&gt;{"RequestInfo":{"context":"Stop All Host Components","operation_level":{"level":"HOST","cluster_name":"cl1","host_names":"ctr-e136-1513029738776-28711-01-000002.hwx.site"},"query":"HostRoles/component_name.in(JOURNALNODE,SPARK_JOBHISTORYSERVER)"},"Body":{"HostRoles":{"state":"STARTED"}}}'&lt;/PRE&gt;&lt;P&gt;"http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components" this is a &lt;STRONG&gt;GET call&lt;/STRONG&gt; and this doesn't require any request body.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jan 2018 22:01:37 GMT</pubDate>
    <dc:creator>ssharma</dc:creator>
    <dc:date>2018-01-02T22:01:37Z</dc:date>
    <item>
      <title>how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179119#M72960</link>
      <description>&lt;P&gt;we have in the ambari 3 workers machines ( data node machines ) &lt;/P&gt;&lt;P&gt;each worker machine has the following components:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;         DataNode ( HDFS )&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; Metrics Monitor &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; NodeManager&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;how to stop/start all these components only on worker machine!&lt;/P&gt;&lt;P&gt;second&lt;/P&gt;&lt;P&gt;is it possible to stop/start the components only on all workers machines ( instead to stop/start each individual work machine )  ?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="47406-capture.png" style="width: 501px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19418iF600A0A8833572C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="47406-capture.png" alt="47406-capture.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="47405-capture.png" style="width: 437px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/19419iBC3719FD21C1433A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="47405-capture.png" alt="47405-capture.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://10.164.235.62:8080/#" rel="nofollow noopener noreferrer" target="_blank"&gt;YARN &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 09:25:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179119#M72960</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2019-08-18T09:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179120#M72961</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;use below api to stop all the components on a host :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PUT : &lt;A href="http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components" target="_blank"&gt;http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Body :&lt;/P&gt;&lt;PRE&gt;{"RequestInfo":{"context":"Stop All Host Components","operation_level":{"level":"HOST","cluster_name":"cl1","host_names":"&amp;lt;host_name&amp;gt;"},"query":"HostRoles/component_name.in(DATANODE,HBASE_REGIONSERVER,JOURNALNODE,METRICS_MONITOR,NFS_GATEWAY,SPARK_JOBHISTORYSERVER)"},"Body":{"HostRoles":{"state":"INSTALLED"}}}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;use below api to start all the components on a host :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PUT : &lt;A href="http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components" target="_blank"&gt;http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Body :&lt;/P&gt;&lt;PRE&gt;{"RequestInfo":{"context":"Start All Host Components","operation_level":{"level":"HOST","cluster_name":"cl1","host_names":"&amp;lt;host_name&amp;gt;"},"query":"HostRoles/component_name.in(DATANODE,HBASE_REGIONSERVER,JOURNALNODE,METRICS_MONITOR,NFS_GATEWAY,SPARK_JOBHISTORYSERVER)"},"Body":{"HostRoles":{"state":"STARTED"}}}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt; : Here "HostRoles/component_name.in" should be replaced with components on a specific host. You can obtain this using the api : &lt;A href="http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;?fields=host_components" target="_blank"&gt;http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;?fields=host_components&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you are planning to write a script to automatically start/stop components on a DATANODE host then you can follow below steps :&lt;/P&gt;&lt;P&gt;1) Use GET &lt;A href="http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/services/HDFS/components/DATANODE/?fields=host_components" target="_blank"&gt;http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/services/HDFS/components/DATANODE/?fields=host_components&lt;/A&gt; to find all the hosts which have DATANODE installed.&lt;/P&gt;&lt;P&gt;2) Then use the PUT apis to STOP/START(as mentioned above) in a loop to perform the required operation on all the respective hosts.&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 18:10:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179120#M72961</guid>
      <dc:creator>ssharma</dc:creator>
      <dc:date>2018-01-02T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179121#M72962</link>
      <description>&lt;P&gt;thank you for the response ,  about the syntax "http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components" , where is the place for body? , can you show me please the full syntax ?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 20:17:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179121#M72962</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-01-02T20:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179122#M72963</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;I guess you would be using curl, so providing the example in curl. This one is for the PUT call.&lt;/P&gt;&lt;PRE&gt;[root@ctr-e136-1513029738776-28711-01-000002 ~]# curl -XPUT -u admin:admin --header X-Requested-By:ambari &lt;A href="http://172.27.67.14:8080/api/v1/clusters/cl1/hosts/ctr-e136-1513029738776-28711-01-000002.hwx.site/host_components" target="_blank"&gt;http://172.27.67.14:8080/api/v1/clusters/cl1/hosts/ctr-e136-1513029738776-28711-01-000002.hwx.site/host_components&lt;/A&gt; -d '&lt;BR /&gt;{"RequestInfo":{"context":"Stop All Host Components","operation_level":{"level":"HOST","cluster_name":"cl1","host_names":"ctr-e136-1513029738776-28711-01-000002.hwx.site"},"query":"HostRoles/component_name.in(JOURNALNODE,SPARK_JOBHISTORYSERVER)"},"Body":{"HostRoles":{"state":"STARTED"}}}'&lt;/PRE&gt;&lt;P&gt;"http://&amp;lt;ambari_server_host&amp;gt;:8080/api/v1/clusters/cl1/hosts/&amp;lt;host_name&amp;gt;/host_components" this is a &lt;STRONG&gt;GET call&lt;/STRONG&gt; and this doesn't require any request body.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2018 22:01:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179122#M72963</guid>
      <dc:creator>ssharma</dc:creator>
      <dc:date>2018-01-02T22:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179123#M72964</link>
      <description>&lt;P&gt;Is it possible to call a script on the host directly to do this shutdown?&lt;BR /&gt;When my server is issue a shutdown command I want to called a script directly to shutdown all ambari components on that host.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 22:49:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179123#M72964</guid>
      <dc:creator>padraig_odowd</dc:creator>
      <dc:date>2018-12-20T22:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179124#M72965</link>
      <description>&lt;P&gt;if your ambari server is down then you cant call API in order to stop the services / components &lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 23:00:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179124#M72965</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-12-20T23:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179125#M72966</link>
      <description>&lt;P&gt;please exept my answer if it fit for you&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 06:33:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179125#M72966</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-12-21T06:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to stop all components on data-node machine ( worker machine ) by rest API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179126#M72967</link>
      <description>&lt;P&gt;Thanks for quick reply.&lt;/P&gt;&lt;P&gt;I meant to call a script to shutdown the ambari components after the server is issued a shutdown command, but before it actually shutdowns!&lt;/P&gt;&lt;P&gt;But I found a solution to the issue anyway - I just needed to add this command "ExecStop=" to the systemd service files and all seems to work fine now.&lt;/P&gt;&lt;P&gt;Thanks again for your quick reply..&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 18:07:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-stop-all-components-on-data-node-machine-worker/m-p/179126#M72967</guid>
      <dc:creator>padraig_odowd</dc:creator>
      <dc:date>2018-12-21T18:07:52Z</dc:date>
    </item>
  </channel>
</rss>

