<?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: Query Ambari to get each host/service racks in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224010#M77441</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Thanks Jay!!&lt;/P&gt;&lt;P&gt;My requirement to check each service get host name and  rack info.Can we achieve this in one api.&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2018 19:03:56 GMT</pubDate>
    <dc:creator>manisha_pande</dc:creator>
    <dc:date>2018-04-19T19:03:56Z</dc:date>
    <item>
      <title>Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224008#M77439</link>
      <description>&lt;P&gt;Do we have any api to get rack info of each /service in an ambari cluster&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:23:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224008#M77439</guid>
      <dc:creator>manisha_pande</dc:creator>
      <dc:date>2018-04-19T18:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224009#M77440</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70482/manishapande.html" nodeid="70482"&gt;@Manisha Pande&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can use the following Ambari API call:&lt;/P&gt;&lt;PRE&gt;# curl -u admin:admin -H "X-Requested-By:ambari" -X GET &lt;A href="http://ambariserver.example.com:8080/api/v1/clusters/TestCluster/hosts?fields=Hosts/rack_info,Hosts/host_name" target="_blank"&gt;http://ambariserver.example.com:8080/api/v1/clusters/TestCluster/hosts?fields=Hosts/rack_info,Hosts/host_name&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Please replace the  "TestCluster" with your own cluster name and the ambari hostname in the above URL.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 18:52:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224009#M77440</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-04-19T18:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224010#M77441</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Thanks Jay!!&lt;/P&gt;&lt;P&gt;My requirement to check each service get host name and  rack info.Can we achieve this in one api.&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 19:03:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224010#M77441</guid>
      <dc:creator>manisha_pande</dc:creator>
      <dc:date>2018-04-19T19:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224011#M77442</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70482/manishapande.html" nodeid="70482"&gt;@Manisha Pande&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you please clarify what exactly do you mean by "check each service get host name and rack info"?&lt;/P&gt;&lt;P&gt;In Each service where do you see the rack info?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 19:10:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224011#M77442</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-04-19T19:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224012#M77443</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For example , I have two hosts in a cluster hostA, HostB&lt;/P&gt;&lt;P&gt;HostA is on rack-1 and HostB is on rack-2&lt;/P&gt;&lt;P&gt;Services components running in hostA are HDFS_CLINET, ZOOKEEPER,NAMENODE..etc&lt;/P&gt;&lt;P&gt;Services components running in hostB are HBASE, AMABRI_METRICS,DATANODE...etc&lt;/P&gt;&lt;P&gt;I want get result from api  like  Host: HostA, Service_component : NAMENODE, rack_info: rack-1                                                   &lt;/P&gt;&lt;P&gt;                                                HostA, Service_component : ZOOKEEPER, rack_info: rack-1&lt;/P&gt;&lt;P&gt;                                                HostB, Service_component : DATANODE, rack_info: rack-2&lt;/P&gt;&lt;P&gt;                                                 --------------------------------------&lt;/P&gt;&lt;P&gt;                                            &lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 19:16:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224012#M77443</guid>
      <dc:creator>manisha_pande</dc:creator>
      <dc:date>2018-04-19T19:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224013#M77444</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70482/manishapande.html" nodeid="70482"&gt;@Manisha Pande&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In that case you cane add the&lt;STRONG&gt; "host_components/HostRoles/service_name"&lt;/STRONG&gt; part in the same API call to also list the components on each host along with the Rack Info. Burt you will have to parse the output based on your requirement.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# curl -u admin:admin -H "X-Requested-By:ambari" -X GET  &lt;A href="http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/hosts?fields=Hosts/rack_info,Hosts/host_name,host_components/HostRoles/service_name" target="_blank"&gt;http://hdfcluster1.example.com:8080/api/v1/clusters/TestCluster/hosts?fields=Hosts/rack_info,Hosts/host_name,host_components/HostRoles/service_name&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 19:28:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224013#M77444</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-04-19T19:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Query Ambari to get each host/service racks</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224014#M77445</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70482/manishapande.html" nodeid="70482"&gt;@Manisha Pande&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If this answers your query/issue then please mark this HCC thread as answered by clicking on "Accept" link on the correct answer, That way it will help other HCC users to quickly find the answers.&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70482/manishapande.html" nodeid="70482"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 08:02:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Query-Ambari-to-get-each-host-service-racks/m-p/224014#M77445</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-05-02T08:02:14Z</dc:date>
    </item>
  </channel>
</rss>

