hive之权限问题AccessControlException Permission denied: user=root, access=WR

问题描述:在集群上,用hive分析数据出现如下错误

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException Permission denied: user=root, access=WRITE, inode="/data/${ip}/20180713":hdfs:supergroup:drwxr-xr-x
at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthorizationProvider.java:257)
at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:238)
at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.check(DefaultAuthorizationProvider.java:216)
at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkPermission(DefaultAuthorizationProvider.java:145)
at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:138)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6609)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:6591)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAncestorAccess(FSNamesystem.java:6543)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FSNamesystem.java:4333)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNamesystem.java:4303)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesystem.java:4276)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameNodeRpcServer.java:867)
at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.mkdirs(AuthorizationProviderProxyClientProtocol.java:322)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.mkdirs(ClientNamenodeProtocolServerSideTranslatorPB.java:603)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:617)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1060)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2086)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2082)
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:1707)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2080)
)

问题分析与解决:

根据报错信息是hdfs文件的权限问题,命令进入集群执行的用户为root,而hdfs文件所有者为hdfs。

要么以用户hdfs执行命令,要么调整hdfs文件的权限

解决方案1:

vim /etc/profile

增加内容

export HADOOP_USER_NAME=hdfs

解决方案2:

vim  $HADOOP_HOME/etc/hadoop/hdfs-site.xml

增加内容

<property>
  <name>dfs.permissions.enabled</name>
  <value>false</value>
  <description>
    If "true", enable permission checking in HDFS.
    If "false", permission checking is turned off,
    but all other behavior is unchanged.
    Switching from one parameter value to the other does not change the mode,
    owner or group of files or directories.
  </description>
</property>

之后重启hdfs namenode

hadoop-daemon.sh stop namenode
hadoop-daemon.sh start namenode

执行完之后,namenode可能会进入安全模式一段时间, 
这时候可能会报错:

name node is in safe mode

稍等一下重试一下即可。 
如果,时间太长了,可以手动停止:

dfsadmin -safemode enter   #进入安全模式
dfsadmin -safemode leave   #离开安全模式
dfsadmin -safemode wait    #等待,一直到安全模式结束

原文地址:https://www.cnblogs.com/lenmom/p/10230131.html

时间: 2024-11-07 01:21:24

hive之权限问题AccessControlException Permission denied: user=root, access=WR的相关文章

kylin cube测试时,报错:org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode=&quot;/user&quot;:hdfs:supergroup:drwxr-xr-x

异常: org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.DefaultAuthorizationProvider.checkFsPermission(DefaultAuthoriza

Exception in thread &quot;main&quot; org.apache.hadoop.security.AccessControlException: Permission denied: user=Mypc, access=WRITE, inode=&quot;/&quot;:fan:supergroup:drwxr-xr-x

在window上编程提示没有写Hadoop的权限 Exception in thread "main" org.apache.hadoop.security.AccessControlException: Permission denied: user=Mypc, access=WRITE, inode="/":fan:supergroup:drwxr-xr-x 曾经踩过的坑: 保存结果到hdfs上没有写的权限* 通过修改权限将文件写入到指定的目录下* * $HAD

异常-Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=hdfs, access=WRITE, inode=&quot;/hbase&quot;:root:supergroup:drwxr-xr-x

1 详细异常 Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=hdfs, access=WRITE, inode="/hbase":root:supergroup:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.DefaultAu

Permission denied: user=root, access=WRITE, inode=&quot;/&quot;:hdfs:supergroup:drwxr-xr-x

通过手动安装CDH没权限 [[email protected] ~]# groupadd supergroup[[email protected] ~]# hadoop fs -mkdir /tao3^C[[email protected] ~]# usermod -a -G supergroup root[[email protected] ~]# hadoop fs -mkdir /tao4 原文地址:https://www.cnblogs.com/yaohaitao/p/11707190.

Permission denied: user=root, access=WRITE, inode=&quot;/&quot;:hadoopuser:supergroup:drwxr-xr-x

提示往HDFS写文件是不容许的. 在conf/hdfs-site.xml中加入: <property> <name>dfs.permissions</name> <value>false</value> </property>

Win下Eclipse提交Hadoop程序出错:org.apache.hadoop.security.AccessControlException: Permission denied: user=D

描述:在Windows下使用Eclipse进行Hadoop的程序编写,然后Run on hadoop 后,出现如下错误: 11/10/28 16:05:53 INFO mapred.JobClient: Running job: job_201110281103_000311/10/28 16:05:54 INFO mapred.JobClient: map 0% reduce 0%11/10/28 16:06:05 INFO mapred.JobClient: Task Id : attemp

HDFS客户端的权限错误:Permission denied

搭建了一个Hadoop的环境,Hadoop集群环境部署在几个Linux服务器上,现在想使用windows上的Java客户端来操作集群中的HDFS文件,但是在客户端运行时出现了如下的认证错误,被折磨了几天,问题终得以解决.以此文记录问题的解决过程. (如果想看最终解决问题的方法拉到最后,如果想看我的问题解决思路请从上向下看) 问题描述 上传文件的代码: private static void uploadToHdfs() throws FileNotFoundException,IOExcepti

从 &amp;quot;org.apache.hadoop.security.AccessControlException:Permission denied: user=...&amp;quot; 看Hadoop 的用户登陆认证

假设远程提交任务给Hadoop 可能会遇到?"org.apache.hadoop.security.AccessControlException:Permission denied: user=..." , 当然,假设是spark over YARN, 也相同会遇到相似的问题,比如: ?An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext. : org.apache.hadoop.

Hive JDBC:Permission denied: user=anonymous, access=EXECUTE, inode=”/tmp”

今天使用JDBC来操作Hive时,首先启动了hive远程服务模式:hiveserver2 &(表示后台运行),然后到eclipse中运行程序时出现错误: Permission denied: user=anonymous, access=EXECUTE, inode="/tmp" 解决办法:报错内容提示hive没有/tmp目录的权限,赋予权限即可: hdfs dfs -chmod 777 /tmp 原文地址:https://www.cnblogs.com/lijinze-tsi