权限报错问题
- [root@hadoop002 hadoop-2.6.0-cdh5.7.0]# bin/hdfs dfs -put README.txt /ruozedata (当不在hadoop用户下的时候,就要严格在其bin目录下执行hdfs的命令)
put: Permission denied: user=root, access=WRITE,inode="/ruozedata":hadoop:supergroup:drwxr-xr-x
rwx hadoop
r-x supergroup
r-x other (权限报错,有两种解决办法,如下:)
a. 切换目录所需的用户 su - hadoop (项目上一般采用的方法)
b. 修改/ruozedata对应的用户和用户组 (一般不用,除非项目上管控不严格,或者测试学习的时候用)
例如:[hadoop@hadoop001 hadoop-2.6.0-cdh5.7.0]$ hdfs dfs -chown -R root:root /ruozedata
[root@hadoop001 hadoop-2.6.0-cdh5.7.0]# bin/hdfs dfs -put LICENSE.txt /ruozedata (则显示上传成功,在hadoop用户下用hdfs dfs -ls /ruozedata 命令可以看到)