【现场问题】CDH文件权限,Permission denied: user=root, access=WRITE, inode=“/user“:hdfs:supergroup:drwxr-xr

Hive执行语句的时候提示 /user权限不够

hive> 
    > select count(*) from fact_sale;
Query ID = root_20201119152619_16f496b5-2482-4efb-a26c-e18117b2f10c
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

解决方案

[root@hp1 ~]# 
[root@hp1 ~]# hadoop fs -ls /
Found 2 items
drwxrwxrwt   - hdfs supergroup          0 2020-11-15 12:22 /tmp
drwxr-xr-x   - hdfs supergroup          0 2020-11-15 12:21 /user
[root@hp1 ~]# 
[root@hp1 ~]# hadoop fs -chmod 777 /user
chmod: changing permissions of '/user': Permission denied. user=root is not the owner of inode=/user
[root@hp1 ~]# 
[root@hp1 ~]# sudo -u hdfs hadoop fs -chmod 777 /user
[root@hp1 ~]# 
[root@hp1 ~]# 
[root@hp1 ~]# hadoop fs -ls /
Found 2 items
drwxrwxrwt   - hdfs supergroup          0 2020-11-15 12:22 /tmp
drwxrwxrwx   - hdfs supergroup          0 2020-11-15 12:21 /user
[root@hp1 ~]# 

你可能感兴趣的:(hive,hadoop,数据仓库)