<?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: Ambari API to find HDFS HA enabled in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160205#M57199</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10616/sgowda.html" nodeid="10616"&gt;@Santhosh B Gowda&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I see that ambari finds out if the NameNode HA is enabled or not using the following logic: &lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py#L295-L307" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py#L295-L307&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did not find a direct Ambari API to findout "isHAEnabled" for HDFS. However we might use the following api to findout the state of the standby/active nodes. That will give an idea if HA is enabled or not.&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=standby" target="_blank"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=standby&lt;/A&gt;

&lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active" target="_blank"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2017 14:35:50 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-03-16T14:35:50Z</dc:date>
    <item>
      <title>Ambari API to find HDFS HA enabled</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160203#M57197</link>
      <description>&lt;P&gt;Can someone please let me know the Ambari API to find whether HDFS is HA enabled or not ? &lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 13:21:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160203#M57197</guid>
      <dc:creator>sgowda</dc:creator>
      <dc:date>2017-03-16T13:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari API to find HDFS HA enabled</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160204#M57198</link>
      <description>&lt;P&gt;I can only see looking for no# of NameNode components. Is there any better way of doing this ?&lt;/P&gt;&lt;PRE&gt;
curl -u admin:admin -H"X-Requested-by:ambari" -i -k -X GET "http://XXX.XXX.XXX.XXX:8080/api/v1/clusters/santhosh/services/HDFS/components/NAMENODE?fields=host_components/HostRoles/component_name"
&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 13:55:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160204#M57198</guid>
      <dc:creator>sgowda</dc:creator>
      <dc:date>2017-03-16T13:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari API to find HDFS HA enabled</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160205#M57199</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10616/sgowda.html" nodeid="10616"&gt;@Santhosh B Gowda&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I see that ambari finds out if the NameNode HA is enabled or not using the following logic: &lt;A href="https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py#L295-L307" target="_blank"&gt;https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params_linux.py#L295-L307&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I did not find a direct Ambari API to findout "isHAEnabled" for HDFS. However we might use the following api to findout the state of the standby/active nodes. That will give an idea if HA is enabled or not.&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=standby" target="_blank"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=standby&lt;/A&gt;

&lt;A href="http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active" target="_blank"&gt;http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 14:35:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160205#M57199</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-16T14:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari API to find HDFS HA enabled</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160206#M57200</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/10616/sgowda.html"&gt;@Santhosh B Gowda&lt;/A&gt; There is no direct rest api call where we find out "isHAEnabled" for HDFS. But when we enabled HA for HDFS, "dfs.nameservices" parameter will gets set. So we get the value of dfs.nameservices from the configs and if it is empty then HA is not enabled. If it contains value HA is enabled.&lt;/P&gt;&lt;P&gt;you can get the configs using the following API.&lt;/P&gt;&lt;P&gt;&lt;A href="http://&amp;lt;AMBARI-SERVER&amp;gt;/api/v1/clusters/cl1/configurations?type=hdfs-site&amp;amp;tag=TOPOLOGY_RESOLVED" target="_blank"&gt;http://&amp;lt;AMBARI-SERVER&amp;gt;/api/v1/clusters/cl1/configurations?type=hdfs-site&amp;amp;tag=TOPOLOGY_RESOLVED&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:21:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-API-to-find-HDFS-HA-enabled/m-p/160206#M57200</guid>
      <dc:creator>mramasami</dc:creator>
      <dc:date>2017-03-16T15:21:22Z</dc:date>
    </item>
  </channel>
</rss>

