<?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: Zookeeper kerberos authentication in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Zookeeper-kerberos-authentication/m-p/147268#M28289</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3209/zhuwchicago.html" nodeid="3209"&gt;@ScipioTheYounger&lt;/A&gt;, I expect this is similar to another question you asked.
&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/35574/switch-namenode-ha-zookeeper-access-from-no-securi.html"&gt;https://community.hortonworks.com/questions/35574/switch-namenode-ha-zookeeper-access-from-no-securi.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'll repeat the same information here for simplicity.&lt;/P&gt;&lt;P&gt;change ha.zookeeper.acl in core-site.xml to this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;ha.zookeeper.acl&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;sasl:nn:rwcda&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;Then, you'd want to run the following to reformat ZooKeeper for NameNode HA, which would reinitialize the znode used by NameNode HA to coordinate automatic failover.&lt;/P&gt;&lt;PRE&gt;hdfs zkfc -formatZK -force&lt;/PRE&gt;&lt;P&gt;The tricky part, as you noticed, is getting that command to authenticate with SASL. The &lt;A href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zookeeper+and+SASL"&gt;ZooKeeper and SASL&lt;/A&gt; guide in the Apache documentation discusses implementation and configuration of SASL in ZooKeeper in detail. For this particular command, you can use this procedure.&lt;/P&gt;&lt;P&gt;First, create a JAAS configuration file at /etc/hadoop/conf/hdfs_jaas.conf:&lt;/P&gt;&lt;PRE&gt;Client {
  com.sun.security.auth.module.Krb5LoginModule required
  useKeyTab=true
  storeKey=true
  useTicketCache=false
  keyTab="/etc/security/keytabs/nn.service.keytab"
  principal="nn/&amp;lt;HOST&amp;gt;@EXAMPLE.COM";
};&lt;/PRE&gt;&lt;P&gt;Note that the will be different depending on the NameNode hostnames in your environment. Likewise, you'll need to change EXAMPLE.COM to the correct Kerberos realm.&lt;/P&gt;&lt;P&gt;Next, edit /etc/hadoop/conf/hadoop-env.sh, and add the following line to enable SASL when running the zkfc command.&lt;/P&gt;&lt;PRE&gt;export HADOOP_ZKFC_OPTS="-Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/etc/hadoop/conf/hdfs_jaas.conf -Dzookeeper.sasl.clientconfig=Client ${HADOOP_ZKFC_OPTS}"&lt;/PRE&gt;&lt;P&gt;Then, run the "hdfs zkfc -formatZK -force" command.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2016 13:13:39 GMT</pubDate>
    <dc:creator>cnauroth</dc:creator>
    <dc:date>2016-06-13T13:13:39Z</dc:date>
    <item>
      <title>Zookeeper kerberos authentication</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Zookeeper-kerberos-authentication/m-p/147267#M28288</link>
      <description>&lt;P&gt;Here is what I found for YARN and HDFS to access ZK using SASL. YARN configuration makes perfect sense. However, is there something missing for HDFS such as configuring its own hdfs_jaas.conf? How about Hive?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_installing_manually_book/content/securing_zookeeper_access.html" target="_blank"&gt;https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.2/bk_installing_manually_book/content/securing_zookeeper_access.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:19:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Zookeeper-kerberos-authentication/m-p/147267#M28288</guid>
      <dc:creator>ScipioTheElder</dc:creator>
      <dc:date>2022-09-16T10:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Zookeeper kerberos authentication</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Zookeeper-kerberos-authentication/m-p/147268#M28289</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3209/zhuwchicago.html" nodeid="3209"&gt;@ScipioTheYounger&lt;/A&gt;, I expect this is similar to another question you asked.
&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/35574/switch-namenode-ha-zookeeper-access-from-no-securi.html"&gt;https://community.hortonworks.com/questions/35574/switch-namenode-ha-zookeeper-access-from-no-securi.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I'll repeat the same information here for simplicity.&lt;/P&gt;&lt;P&gt;change ha.zookeeper.acl in core-site.xml to this:&lt;/P&gt;&lt;PRE&gt;&amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;ha.zookeeper.acl&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;sasl:nn:rwcda&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;Then, you'd want to run the following to reformat ZooKeeper for NameNode HA, which would reinitialize the znode used by NameNode HA to coordinate automatic failover.&lt;/P&gt;&lt;PRE&gt;hdfs zkfc -formatZK -force&lt;/PRE&gt;&lt;P&gt;The tricky part, as you noticed, is getting that command to authenticate with SASL. The &lt;A href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zookeeper+and+SASL"&gt;ZooKeeper and SASL&lt;/A&gt; guide in the Apache documentation discusses implementation and configuration of SASL in ZooKeeper in detail. For this particular command, you can use this procedure.&lt;/P&gt;&lt;P&gt;First, create a JAAS configuration file at /etc/hadoop/conf/hdfs_jaas.conf:&lt;/P&gt;&lt;PRE&gt;Client {
  com.sun.security.auth.module.Krb5LoginModule required
  useKeyTab=true
  storeKey=true
  useTicketCache=false
  keyTab="/etc/security/keytabs/nn.service.keytab"
  principal="nn/&amp;lt;HOST&amp;gt;@EXAMPLE.COM";
};&lt;/PRE&gt;&lt;P&gt;Note that the will be different depending on the NameNode hostnames in your environment. Likewise, you'll need to change EXAMPLE.COM to the correct Kerberos realm.&lt;/P&gt;&lt;P&gt;Next, edit /etc/hadoop/conf/hadoop-env.sh, and add the following line to enable SASL when running the zkfc command.&lt;/P&gt;&lt;PRE&gt;export HADOOP_ZKFC_OPTS="-Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/etc/hadoop/conf/hdfs_jaas.conf -Dzookeeper.sasl.clientconfig=Client ${HADOOP_ZKFC_OPTS}"&lt;/PRE&gt;&lt;P&gt;Then, run the "hdfs zkfc -formatZK -force" command.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 13:13:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Zookeeper-kerberos-authentication/m-p/147268#M28289</guid>
      <dc:creator>cnauroth</dc:creator>
      <dc:date>2016-06-13T13:13:39Z</dc:date>
    </item>
  </channel>
</rss>

