在运行以下命令时,我从hdfs获得了拒绝权限失败:
hive -e "insert overwrite directory '/user/hadoop/a/b/c/d/e/f' select * from table_name limit 10;"
错误消息是:
Permission denied: user=hadoop, access=WRITE, inode="/user/hadoop/a/b":hdfs:hive:drwxrwxr-x
但当我跑的时候: hadoop fs -ls /user/hadoop/a
,我得到:
drwxrwxrwx - hadoop supergroup 0 2014-04-08 00:56 /user/hadoop/a/b
似乎我已经打开了文件夹b的完全权限,为什么我的权限仍然被拒绝?
附言:我已经准备好了 hive.insert.into.multilevel.dirs=true
在配置单元配置文件中。
3条答案
按热度按时间gcxthw6b1#
打开一个新终端,然后尝试以下操作:
1.)将用户更改为根用户:
2.)将用户更改为hdfs:
3.)然后运行以下命令:
现在您可以尝试运行的命令。
希望对你有帮助。。。!!!
pprl5pva2#
问题实际上不是目录权限的问题。配置单元应该可以访问路径,我的意思是不在文件级别。
下面是有关如何向用户/组授予对hdfs路径和数据库的访问权限的步骤。每个命令的注解都以
#
```Login as hive superuser to perform the below steps
create role <role_name_x>;
For granting to database
grant all on database to role <role_name_x>;
For granting to HDFS path
grant all on URI '/hdfs/path' to role <role_name_x>;
Granting the role to the user you will use to run the hive job
grant role <role_name_x> to group <your_user_name>;
After you perform the below steps you can validate with the below commands
grant role should show the URI or database access when you run the grant role check on the role name as below
show grant role <role_name_x>;
Now to validate if the user has access to the role
show role grant group <your_user_name>;
hdfs dfs -getfacl /tmp/
file: /tmp
owner: hdfs
group: supergroup
flags: --t
user::rwx
group::rwx
other::rwx
hgqdbh6s3#
我也遇到了同样的问题,我只是通过使用完全限定的hdfs路径来解决它。这样地。
这里提到这个问题。
但是,我不知道根本原因,但它与权限无关。