<?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: What's purpose of shell(/bin/true) in HDFS HA fencer? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152514#M32695</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/10764/xzhou.html" nodeid="10764"&gt;@Xiaobing Zhou&lt;/A&gt;&lt;P&gt;There are 2 methods for fencing. shell and ssh. In your example shell fencing is used. this command will always return true and fencing will happen if there is an issue with the current active NN. for ssh fence, you need to setup passwordless ssh from active to standby and vice varsa. &lt;/P&gt;&lt;P&gt;Please read more about fencing at below link (refer &lt;B&gt;dfs.ha.fencing.methods)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html" target="_blank"&gt;https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2016 07:55:26 GMT</pubDate>
    <dc:creator>KuldeepK</dc:creator>
    <dc:date>2016-06-23T07:55:26Z</dc:date>
    <item>
      <title>What's purpose of shell(/bin/true) in HDFS HA fencer?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152513#M32694</link>
      <description>&lt;P&gt;In the process of exploring HDFS HA with ZKFC, I noticed 'dfs.ha.fencing.methods' is configured as 'shell(/bin/true)'. Would anyone explain what's the purpose of this conf? As a bonus, it's better to highlight high level failover flow within which how this conf is applied? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 06:38:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152513#M32694</guid>
      <dc:creator>xzhou</dc:creator>
      <dc:date>2016-06-23T06:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: What's purpose of shell(/bin/true) in HDFS HA fencer?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152514#M32695</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/10764/xzhou.html" nodeid="10764"&gt;@Xiaobing Zhou&lt;/A&gt;&lt;P&gt;There are 2 methods for fencing. shell and ssh. In your example shell fencing is used. this command will always return true and fencing will happen if there is an issue with the current active NN. for ssh fence, you need to setup passwordless ssh from active to standby and vice varsa. &lt;/P&gt;&lt;P&gt;Please read more about fencing at below link (refer &lt;B&gt;dfs.ha.fencing.methods)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html" target="_blank"&gt;https://hadoop.apache.org/docs/r2.7.1/hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 07:55:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152514#M32695</guid>
      <dc:creator>KuldeepK</dc:creator>
      <dc:date>2016-06-23T07:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: What's purpose of shell(/bin/true) in HDFS HA fencer?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152515#M32696</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10764/xzhou.html" nodeid="10764"&gt;@Xiaobing Zhou&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is why we need always true fencing as a second option.&lt;/P&gt;&lt;P&gt;This is done for workaround cases where the primary NameNode machine goes down and the ssh method will fail, and no failover will be performed. We want to avoid this, so the second option would be to failover anyway, even without fencing, which, as already mentioned, is safe with our setup. To achieve this, we specify two fencing methods, which will be tried by ZKFC in the order of: if the first one fails, the second one will be tried. In our case, the second one will always return success and failover will be initiated, even if the server running the primary NameNode is not available via ssh.&lt;/P&gt;&lt;P&gt;We have tested this approach and it worked fine specially when Primary NN host down due to major hardware/power failure. Ref. &lt;A href="https://www.packtpub.com/books/content/setting-namenode-ha" target="_blank"&gt;https://www.packtpub.com/books/content/setting-namenode-ha&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 20:46:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152515#M32696</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-06-23T20:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: What's purpose of shell(/bin/true) in HDFS HA fencer?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152516#M32697</link>
      <description>&lt;P&gt;
	Hi 
	&lt;A rel="user" href="https://community.cloudera.com/users/10764/xzhou.html" nodeid="10764"&gt;@Xiaobing Zhou&lt;/A&gt;, I think the requirement to have shell(/bin/true) which is essentially a no-op fencer can be eliminated. There is no technical reason to require the no-op fencer.&lt;/P&gt;&lt;P&gt;The code that instantiates a fencer is in NodeFencer.java&lt;/P&gt;
&lt;PRE&gt;public static NodeFencer create(Configuration conf, String confKey)
    throws BadFencingConfigurationException {
  String confStr = conf.get(confKey);
  if (confStr == null) {
    return null;
  }
  return new NodeFencer(conf, confStr);
}
&lt;/PRE&gt;&lt;P&gt;
	A potential improvement is to instantiate a dummy fencer if dfs.ha.fencing.methods is undefined i.e. the confStr == null case above.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 06:35:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/What-s-purpose-of-shell-bin-true-in-HDFS-HA-fencer/m-p/152516#M32697</guid>
      <dc:creator>ArpitAgarwal</dc:creator>
      <dc:date>2016-06-24T06:35:39Z</dc:date>
    </item>
  </channel>
</rss>

