hdfs权限问题

当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>

然后重启

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值