<?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: HA  Hadoop core in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218427#M72288</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14934/majnam.html" nodeid="14934"&gt;@Ivan Majnaric&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Your following property should be pointing to the NameService instead of the Individual NN host.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Incorrect code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;conf.set("fs.defaultFS", "hdfs://bigdata5.int.ch:8020");
conf.set("dfs.ha.namenodes.nameservice1", "nn1,nn2");&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Should be something like following: &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;conf.set("fs.defaultFS", "hdfs://hdfscluster");
conf.set("dfs.ha.namenodes.hdfscluster", "nn1,nn2");&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For more details please refer to:  &lt;A href="http://henning.kropponline.de/2016/11/27/sample-hdfs-ha-client/" target="_blank"&gt;http://henning.kropponline.de/2016/11/27/sample-hdfs-ha-client/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 18:15:10 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-12-05T18:15:10Z</dc:date>
    <item>
      <title>HA  Hadoop core</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218426#M72287</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I'm trying to make HA Hadoop client for Spark job (need for spark warehouse) which will switch from NN1 to NN2 if NN1 breaks down. &lt;/P&gt;&lt;PRE&gt;public class ConfigFactoryTest {
    public static void main(String [] args) throws IOException {


        HdfsConfiguration conf = new HdfsConfiguration(true);
        conf.set("fs.defaultFS", "hdfs://bigdata5.int.ch:8020");
        conf.set("fs.default.name", conf.get("fs.defaultFS"));
        conf.set("dfs.nameservices","hdfscluster");
        conf.set("dfs.ha.namenodes.nameservice1", "nn1,nn2");
        conf.set("dfs.namenode.rpc-address.hdfscluster.nn1","bigdata1.int.ch:8020");
        conf.set("dfs.namenode.rpc-address.hdfscluster.nn2", "bigdata5.int.ch:8020");
        conf.set("dfs.client.failover.proxy.provider.hdfscluster","org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");


          FileSystem fs = FileSystem.get(conf);
          while(true){
          FileStatus[] fsStatus =  fs.listStatus(new Path("/"));

          for(int i = 0; i &amp;lt; fsStatus.length; i++) {
              System.out.println(fsStatus[i].getPath().toString());
          }
        }
    }
    }

&lt;/PRE&gt;&lt;P&gt;Or I followed examples but when I tried to turn NN1 while this client is running, I'm getting exception that NN1 isnt available anymore and application is shutting down. Can someone point me in right direction? &lt;BR /&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:05:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218426#M72287</guid>
      <dc:creator>majnam</dc:creator>
      <dc:date>2017-12-05T18:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: HA  Hadoop core</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218427#M72288</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14934/majnam.html" nodeid="14934"&gt;@Ivan Majnaric&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Your following property should be pointing to the NameService instead of the Individual NN host.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Incorrect code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;conf.set("fs.defaultFS", "hdfs://bigdata5.int.ch:8020");
conf.set("dfs.ha.namenodes.nameservice1", "nn1,nn2");&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Should be something like following: &lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;conf.set("fs.defaultFS", "hdfs://hdfscluster");
conf.set("dfs.ha.namenodes.hdfscluster", "nn1,nn2");&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For more details please refer to:  &lt;A href="http://henning.kropponline.de/2016/11/27/sample-hdfs-ha-client/" target="_blank"&gt;http://henning.kropponline.de/2016/11/27/sample-hdfs-ha-client/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:15:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218427#M72288</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-12-05T18:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: HA  Hadoop core</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218428#M72289</link>
      <description>&lt;P&gt;Thank you very much sir. You solved my case &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:45:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HA-Hadoop-core/m-p/218428#M72289</guid>
      <dc:creator>majnam</dc:creator>
      <dc:date>2017-12-05T18:45:47Z</dc:date>
    </item>
  </channel>
</rss>

