当hdfs的所有权限不属于root时:
注:对CDH用户:对于文件夹/user,注意,这个文件夹的拥有者不是所谓的“root”。实际上,这个文件夹为“hdfs”所有(755权限,这里将hdfs理解为一个属于supergroup的用户)
#解决权限问题
方案一:
vim /etc/profile
#增加内容(创建该所有者)
export HADOOP_USER_NAME=hdfs
#使用该所有者更改权限
su hdfs
如:
hdfs dfs -chmod +w /user/spark
方案二:
在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>
然后重启

4084

被折叠的 条评论
为什么被折叠?



