问题描述
我正在使用Cloudera在我正在玩的VM机器上。不幸的是我有问题将数据复制到HDFS,我得到以下内容:
pre code $ [cloudera @ localhost〜] $ hadoop fs -mkdir输入
mkdir:权限被拒绝:user = cloudera,access = WRITE,inode =/ user:hdfs:supergroup:drwxr-xr-x
我不太关心这个虚拟机上的安全性,是否有可以在HDFS上打开更多的安全性?
sudo -u hdfs hadoop fs -mkdir / import
则会创建导入文件夹。如果你想改变这个文件夹的所有者运行:
sudo -u hdfs hadoop fs -chown new_user / import
现在, new_user 可以操作 import 文件夹
I am using Cloudera on a VM machine that I am playing around with. Unfortunately I am having issues copying data to the HDFS, I am getting the following:
[cloudera@localhost ~]$ hadoop fs -mkdir input mkdir: Permission denied: user=cloudera, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x
I am not too concerned about security on this VM, is there anyway I can open up security more on HDFS?
Using mkdir in hadoop needs the "hadoop file permissions". From your example you can see that hdfs is a user that has permissions to create folders. So if you run:
sudo -u hdfs hadoop fs -mkdir /import
then the import folder will be created. If you want to change the owner of this folder run:
sudo -u hdfs hadoop fs -chown new_user /import
Now the new_user can manipulate files inside the import folder
这篇关于为什么“hadoop fs -mkdir”权限被拒绝失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!