<?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: HDFS diskbalancer unexpected permission denied error in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79165#M82780</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;kindly weichiu, that did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just briefly, for people&amp;nbsp;with the same problem, I had to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1. SSH to the node in question
2. cd /var/run/cloudera-scm-agent/process &amp;amp;&amp;amp; find . -type f -iname "hdfs.keytab"
n.b.: it will probably be under &amp;lt;pid&amp;gt;-hdfs-DATANODE/hdfs.keytab
3. Use the keytab to get a ticket
kinit -k -t ./&amp;lt;pid&amp;gt;-hdfs-DATANODE/hdfs.keytab -p hdfs/&amp;lt;NODE_FQDN&amp;gt;@&amp;lt;OUR_REALM&amp;gt;&lt;BR /&gt;4. Proceed with the diskbalancer plan/execution&lt;/PRE&gt;&lt;P&gt;This in contrast to hdfs@&amp;lt;OUR_REALM&amp;gt;, which is a principal that&amp;nbsp;was created manually (and is accepted for many superuser hdfs commands).&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 10:18:11 GMT</pubDate>
    <dc:creator>Matt_</dc:creator>
    <dc:date>2018-08-29T10:18:11Z</dc:date>
    <item>
      <title>HDFS diskbalancer unexpected permission denied error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79115#M82777</link>
      <description>&lt;P&gt;Hiya,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am&amp;nbsp;trying to balance the&amp;nbsp;data disks on&amp;nbsp;a few of our&amp;nbsp;DataNodes.&amp;nbsp;The cluster is Kerberos-enabled and uses Sentry. I get a permission denied error&amp;nbsp;while&amp;nbsp;trying to&amp;nbsp;create a plan with the diskbalancer CLI tool. I don't understand why this is happening and would appreciate some help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;root@head01:~# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: hdfs@&amp;lt;OUR_REALM&amp;gt;

Valid starting       Expires              Service principal
08/28/2018 08:54:46  08/28/2018 18:54:46  krbtgt/&amp;lt;OUR_REALM&amp;gt;@&amp;lt;OUR_REALM&amp;gt;
        renew until 08/29/2018 08:54:39&lt;BR /&gt;
root@head01:~# hdfs diskbalancer -plan node13.&amp;lt;our_fqdn&amp;gt;
18/08/28 09:25:52 INFO balancer.KeyManager: Block token params received from NN: update interval=10hrs, 0sec, token lifetime=10hrs, 0sec
18/08/28 09:25:52 INFO block.BlockTokenSecretManager: Setting block keys
18/08/28 09:25:52 INFO balancer.KeyManager: Update block keys every 2hrs, 30mins, 0sec
18/08/28 09:25:53 ERROR tools.DiskBalancerCLI: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied.
        at org.apache.hadoop.hdfs.server.datanode.DataNode.checkSuperuserPrivilege(DataNode.java:986)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.getDiskBalancerSetting(DataNode.java:3245)
        at org.apache.hadoop.hdfs.protocolPB.ClientDatanodeProtocolServerSideTranslatorPB.getDiskBalancerSetting(ClientDatanodeProtocolServerSideTranslatorPB.java:361)
        at org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos$ClientDatanodeProtocolService$2.callBlockingMethod(ClientDatanodeProtocolProtos.java:17901)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1073)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2281)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2277)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1917)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2275)&lt;/PRE&gt;&lt;P&gt;The error in node13's DATANODE logs is similar:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;2018-08-28 09:25:38,529 WARN org.apache.hadoop.security.UserGroupInformation: PriviledgedActionException as:hdfs@&amp;lt;OUR_REALM&amp;gt; (auth:KERBEROS) cause:org.apache.hadoop.security.AccessControlException: Permission denied.&lt;BR /&gt;2018-08-28 09:25:53,157 INFO org.apache.hadoop.ipc.Server: IPC Server handler 1 on 50020, call org.apache.hadoop.hdfs.protocol.ClientDatanodeProtocol.getDiskBalancerSetting from &amp;lt;node13_address&amp;gt;:58529 Call#9 Retry#0
org.apache.hadoop.security.AccessControlException: Permission denied.
        at org.apache.hadoop.hdfs.server.datanode.DataNode.checkSuperuserPrivilege(DataNode.java:986)
        at org.apache.hadoop.hdfs.server.datanode.DataNode.getDiskBalancerSetting(DataNode.java:3245)
        at org.apache.hadoop.hdfs.protocolPB.ClientDatanodeProtocolServerSideTranslatorPB.getDiskBalancerSetting(ClientDatanodeProtocolServerSideTranslatorPB.java:361)
        at org.apache.hadoop.hdfs.protocol.proto.ClientDatanodeProtocolProtos$ClientDatanodeProtocolService$2.callBlockingMethod(ClientDatanodeProtocolProtos.java:17901)
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1073)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2281)
        at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2277)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1917)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2275)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that "hdfs diskbalancer -report" gives&amp;nbsp;the expected output (i.e., no errors). If I switch to a non-hdfs principal it does give the expected error. So I'm a bit puzzled where the permission issue kicks in.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:38:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79115#M82777</guid>
      <dc:creator>Matt_</dc:creator>
      <dc:date>2022-09-16T13:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS diskbalancer unexpected permission denied error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79135#M82778</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/28857"&gt;@Matt_&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It may possible if your JAVA_HOME is not referring to the right path.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;export JAVA_HOME=&amp;lt;the right path -or- (usually /usr/java)&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please check java path at node13 and set the right path and try again, it may help you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:46:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79135#M82778</guid>
      <dc:creator>saranvisa</dc:creator>
      <dc:date>2018-08-28T17:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS diskbalancer unexpected permission denied error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79136#M82779</link>
      <description>You are probably on CDH5.10 or later.&lt;BR /&gt;Please login as hdfs/node13.&amp;lt;our_fqdn&amp;gt;@&amp;lt;OUR_REALM&amp;gt; instead of hdfs@&amp;lt;OUR_REALM&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;Related jira: HDFS-11069. (Tighten the authorization of datanode RPC.)</description>
      <pubDate>Tue, 28 Aug 2018 17:58:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79136#M82779</guid>
      <dc:creator>weichiu</dc:creator>
      <dc:date>2018-08-28T17:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS diskbalancer unexpected permission denied error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79165#M82780</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;kindly weichiu, that did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just briefly, for people&amp;nbsp;with the same problem, I had to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1. SSH to the node in question
2. cd /var/run/cloudera-scm-agent/process &amp;amp;&amp;amp; find . -type f -iname "hdfs.keytab"
n.b.: it will probably be under &amp;lt;pid&amp;gt;-hdfs-DATANODE/hdfs.keytab
3. Use the keytab to get a ticket
kinit -k -t ./&amp;lt;pid&amp;gt;-hdfs-DATANODE/hdfs.keytab -p hdfs/&amp;lt;NODE_FQDN&amp;gt;@&amp;lt;OUR_REALM&amp;gt;&lt;BR /&gt;4. Proceed with the diskbalancer plan/execution&lt;/PRE&gt;&lt;P&gt;This in contrast to hdfs@&amp;lt;OUR_REALM&amp;gt;, which is a principal that&amp;nbsp;was created manually (and is accepted for many superuser hdfs commands).&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 10:18:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79165#M82780</guid>
      <dc:creator>Matt_</dc:creator>
      <dc:date>2018-08-29T10:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS diskbalancer unexpected permission denied error</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79166#M82781</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/28857"&gt;@Matt_&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can give you two easy steps ,&amp;nbsp;it may reduce your burden&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1. To list the valid kerberos principal
	$ cd /var/run/cloudera-scm-agent/process/&amp;lt;pid&amp;gt;-hdfs-DATANODE
	$ klist -kt hdfs.keytab
	## The klist command will list the valid kerbros principal in the following format "hdfs/&amp;lt;NODE_FQDN&amp;gt;@&amp;lt;OUR_REALM&amp;gt;"

2. to kinit with the aboev listed full path
	$ kinit -kt hdfs.keytab &amp;lt;copy paste the any one of the hdfs principal from the above klist&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 10:29:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HDFS-diskbalancer-unexpected-permission-denied-error/m-p/79166#M82781</guid>
      <dc:creator>saranvisa</dc:creator>
      <dc:date>2018-08-29T10:29:15Z</dc:date>
    </item>
  </channel>
</rss>

