Why does “hadoop fs -mkdir” fail with Permission Denied?

后端 未结 6 809
甜味超标
甜味超标 2020-12-28 18:22

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:

[cl         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-28 18:59

    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

提交回复
热议问题