<?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: Figuring out the active name node of a remote Hadoop cluster. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/375126#M37866</link>
    <description>&lt;P&gt;Try this option:&lt;/P&gt;&lt;P&gt;[serviceaccount@edgenode ~]$ hdfs getconf -confKey dfs.nameservices&lt;BR /&gt;hadoopcdhnn&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs getconf -confKey dfs.ha.namenodes.hadoopcdhnn&lt;BR /&gt;namenode5605,namenode5456&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs haadmin -getServiceState namenode5605&lt;BR /&gt;active&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs haadmin -getServiceState namenode5456&lt;BR /&gt;standby&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2023 04:48:12 GMT</pubDate>
    <dc:creator>DhanoojK</dc:creator>
    <dc:date>2023-08-11T04:48:12Z</dc:date>
    <item>
      <title>Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174702#M37859</link>
      <description>&lt;P&gt;I have specific requirements for applications I'm building that need to access remote clusters. By "remote" I mean a Hadoop cluster whose configuration is not stored in the local hdfs-site/core-site xml files on the server the application is hosted.&lt;/P&gt;&lt;P&gt;I've found the easiest way to connect to a remote cluster in Java is to just use the FileSystem api and pass in the active name node along with a configuration. However, it is bad practice, insecure, and unreliable to store Hadoop cluster configurations for a cluster in the code itself.&lt;/P&gt;&lt;P&gt;Is there a "right" way to be getting a remote cluster's active name node? Does Hadoop provide an API or something that I could call to get this information?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 21:48:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174702#M37859</guid>
      <dc:creator>william_bolton</dc:creator>
      <dc:date>2016-08-15T21:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174703#M37860</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12512/william-bolton.html" nodeid="12512"&gt;@William Bolton&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When you have Namenode HA enabled, you have what's called a "nameservice". You specify nameservice and let Hadoop configuration take care of connecting to whatever the active namenode is. You don't have to worry about which namenode is active in your client code. By the way, you should use client side configuration files to connect to the cluster.&lt;/P&gt;&lt;P&gt;You would specify the following in your hdfs-site.xml when you enable HA so you have a nameservice.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dfs.nameservices&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dfs.ha.namenodes.[nameservice ID]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dfs.namenode.rpc-address.[nameservice ID].[name node ID] or&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dfs.namenode.http-address.[nameservice ID].[name node ID]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;check the following link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html" target="_blank"&gt;https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 22:03:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174703#M37860</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-08-15T22:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174704#M37861</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/12512/william-bolton.html" nodeid="12512"&gt;@William Bolton&lt;/A&gt; You can use JMX to get the HA state (tag.HAState)&lt;/P&gt;&lt;P&gt;For more information you can refer&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_hdfs_admin_tools/content/ch07.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_hdfs_admin_tools/content/ch07.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 16:34:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174704#M37861</guid>
      <dc:creator>nshetty</dc:creator>
      <dc:date>2016-08-17T16:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174705#M37862</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/12512/william-bolton.html"&gt;@William Bolton&lt;/A&gt; You can use the below ambari api to get the Active NN:&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://{HOST}:8080/api/v1/clusters/{CLUSTER_NAME}/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active" target="_blank"&gt;http://{HOST}:8080/api/v1/clusters/{CLUSTER_NAME}/host_components?HostRoles/component_name=NAMENODE&amp;amp;metrics/dfs/FSNamesystem/HAState=active&lt;/A&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 16:49:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174705#M37862</guid>
      <dc:creator>mramasami</dc:creator>
      <dc:date>2016-08-17T16:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174706#M37863</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/12512/william-bolton.html" nodeid="12512"&gt;@William Bolton&lt;/A&gt;, are these applications accessing HDFS directly? What's the mode of access e.g. WebHDFS REST API, Java APIs or something else?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 01:11:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174706#M37863</guid>
      <dc:creator>ArpitAgarwal</dc:creator>
      <dc:date>2016-08-18T01:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174707#M37864</link>
      <description>&lt;P&gt;To find the active namenode, we can try executing the test hdfs command on each of the namenodes and find the active name node corresponding to the successful run.&lt;/P&gt;&lt;P&gt;Below command executes successfully if the name node is active and fails if it is a standby node.&lt;/P&gt;&lt;PRE&gt;hadoop fs -test -e hdfs://&amp;lt;Name node&amp;gt;/
&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Unix script&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;active_node=''
if hadoop fs -test -e hdfs://&amp;lt;NameNode-1&amp;gt;/ ; then
active_node='&amp;lt;NameNode-1&amp;gt;'
elif hadoop fs -test -e hdfs://&amp;lt;NameNode-2&amp;gt;/ ; then
active_node='&amp;lt;NameNode-2&amp;gt;'
fi

echo "Active Dev Name node : $active_node"&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jun 2017 10:29:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174707#M37864</guid>
      <dc:creator>munesh_nani</dc:creator>
      <dc:date>2017-06-27T10:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174708#M37865</link>
      <description>&lt;P&gt;Could anyone please tell how can I get the core-site.xml, hdfs-site.xml. I am building a gradle project in which I have to create a directory on hdfs which is on a remote server.  &lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 23:06:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/174708#M37865</guid>
      <dc:creator>abhi97_fool</dc:creator>
      <dc:date>2019-05-30T23:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Figuring out the active name node of a remote Hadoop cluster.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/375126#M37866</link>
      <description>&lt;P&gt;Try this option:&lt;/P&gt;&lt;P&gt;[serviceaccount@edgenode ~]$ hdfs getconf -confKey dfs.nameservices&lt;BR /&gt;hadoopcdhnn&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs getconf -confKey dfs.ha.namenodes.hadoopcdhnn&lt;BR /&gt;namenode5605,namenode5456&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs haadmin -getServiceState namenode5605&lt;BR /&gt;active&lt;BR /&gt;[serviceaccount@edgenode ~]$ hdfs haadmin -getServiceState namenode5456&lt;BR /&gt;standby&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 04:48:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Figuring-out-the-active-name-node-of-a-remote-Hadoop-cluster/m-p/375126#M37866</guid>
      <dc:creator>DhanoojK</dc:creator>
      <dc:date>2023-08-11T04:48:12Z</dc:date>
    </item>
  </channel>
</rss>

